In shell scripting, a shell such as bash runs a file containing a list of commands (a script). The script is effectively a program and the shell is its interpreter.

learn more… | top users | synonyms

1
vote
1answer
37 views

Is there a way to reprogram the thinkvantage button to assign a shell bash program to it?

Is there a way to reprogram the lenovo think vantage button to open and run a shell bash program on ubuntu 14.04 lts? I have tried system preferences > keyboard >shortcuts > custom and assigned a ...
1
vote
1answer
51 views

Problem with shell script to reboot computer/switch to windows

I have little experience with linux and hardly ever wrote an shell script, but needed a workstation with both windows and linux to do certain calculations. The workstation is however mostly used ...
1
vote
1answer
27 views

How to retain back to the last permission of file or directory

I have accidentally changed the permission of a file now I want that file to back to the last permission state but how to do this? Is there any procedure or tool or any command line script which keep ...
1
vote
1answer
118 views

How to find the path of a freshly mounted USB Drive dynamically?

I want a side script or a settings change that fires a second or primary script that does the actual work. I do not need to do it just for my computer. So it should work on any Linux computer. I need ...
1
vote
1answer
37 views

Concatenate of Hostname in script is not working

I have to concatenate the Hostname in a file name and ssh it to a machine what i have currently is scp ../output/OutputFile50.txt sarah:~/client/output/OutputFile50${HOSTNAME}.txt it is working ...
1
vote
1answer
1k views

Permission when running script in Vagrant using Vagrantfile

I have created a vagrant box for running rails applications and I have managed to create it manually. My next step was to create a shell script that I can include in the Vagrantfile so when creating ...
1
vote
1answer
66 views

Telnet at Login Question

I am trying to setup a dummy terminal. The system automatically signs in as the user I want. The next step is for it to automatically telnet to a server. I have the autologin working and the ...
1
vote
1answer
72 views

ffmpeg-video trim from the end of the video

I have some videos of different duration.I want to cut(remove) the last 5 seconds of all videos.Can i use 'ffmpeg' in a loop to trim the videos?please help me.
1
vote
1answer
502 views

specify non-printing keys as input to shell command

Ubuntu 12.04 LTS Server 64 I have a shell script that runs in unattended mode. The script executes a command that displays a curses/ncurses UI which normally expects the user to navigate a menu via ...
1
vote
1answer
244 views

Shell script now working on post/get request

I have a simple script in php to fetch files from my github repository <?php echo shell_exec('git pull'); ?> When I ssh into my server and run this script like this: php github.php I see ...
0
votes
1answer
32 views

How to run a script on a remote computer from a local computer over ssh and save the ouput on the local computer to analyze further?

Lets say i have a script in my local computer like the below one which will list files of a directory on my remote computer and run a "for" loop to save the files on my local computer. Then a check ...
0
votes
1answer
207 views

How to fix invalid identifier error after setting environment variables?

I'm trying to setup cocos2dx in Ubuntu 14.04 LTS but after setting the environmental variables (in .bashrc) I start getting this error: bash: export: dev/cocos2d-x-3.2/tools/cocos2d-console/bin': not ...
3
votes
0answers
409 views

Execute a shell-script when closing laptop lid

Now I have two scripts and I want to execute them respectively when I close the laptop lip and open it. How can I do this?
2
votes
0answers
42 views

How to have a video player resume from where I last left off?

I'd like to be able to launch a video player (VLC, SMPlayer) via Terminal, using some command like resume_media and then it will automatically find the most recently played media file (.mkv, mp4 etc.) ...
2
votes
0answers
384 views

How to persistently maintain cloned mac address on Network Manager?

I'm on Gnome 3, and it seems like I'm able to add cloned mac address to my network interfaces from the GUI wizard of Network Manager. The catch is, every time I reboot my computer the cloned mac ...
2
votes
0answers
658 views

Script to quit and restart nautilus doesn't work

As I pointed out in my question nautilus theme problem in 12.04 I have to type 4 commands after every logon as workaround for a theming problem. Since I didn't find a real solution I decided to put ...
2
votes
0answers
216 views

Block unauthorized usb device. Disable automount

I wrote a bash script that checks every second for new mounted USB devices. When a new device is mounted, my script gets its serial number and compares it with the serials I wrote in a text file, ...
1
vote
0answers
24 views

How to terminate server process?

I just created automation sending an email using a shell script, but it always running and send me an email every sec to my email. I'm using PID and that process name to terminate it, I'm writing ...
1
vote
0answers
33 views

Unable to connect to X11 display. is $DISPLAY set? - Yes, it is

I'm trying to run this in my /etc/init.d/rc.local. I had to manually add the exit 0 because it wasn't there by default if that makes any difference. cd /home/john/xcape && ./xcape -e ...
1
vote
0answers
39 views

14.04 update problem with executable file mode

Here's the problem: I create a file called foo.pl containing #!/usr/bin/perl as the top line I execute chmod u+x foo.pl I type ./foo.pl at the command prompt and get the following bash: ./foo.pl: ...
1
vote
0answers
39 views

How can I automatically reboot machine after usb pull off?

I have this situation - I've got a boot-able pen-drive with Ubuntu 12.04 for automated installation - when I plug the USB stick in installation begins from it. At the end of installation process I ...
1
vote
0answers
131 views

How to set grub install device non-interactively

I'm writing a bash script that runs on a fresh install of Ubuntu 12.04 and installs a bunch of packages non-interactively. The problem is that grub reports the following error when I run apt-get ...
0
votes
0answers
15 views

display number of packets

need to write a script that takes and interface as parameter and prints to stdout like this: interface TX: no.of tx packs sent RX: no of rx packs sent this is what i have written, but it prints the ...
0
votes
0answers
18 views

Simple Mount Script Not Working?

just really not understanding what's wrong here. I had a script that worked fine on 14.04, but I screwed up something on there and accidentally removed some system apps and made it fail to boot. So, I ...
0
votes
0answers
16 views

How to get a list (from shell) of Icon Themes installed?

I'm developing a simple script for change the icon theme with Unity. How could I know all the current (Ubuntu & Unity) System Icon Themes with a shell command? There are a few folders in ...
0
votes
0answers
13 views

x-shellscript opening with gedit

I've downlodaded this plymouth theme, but when I try running the install-orb script, it opens in gedit I already checked "Allow executing file as program" in properties, but it won't solve. @edit ...
0
votes
0answers
15 views

How to batch download youtube-dl trailer based on a folder name?

I have some folders with movies and I am trying to figure out how to download trailers from youtube Folder structure: |-Movie Name #1 (2008) |-Movie Name #2 (2013) |-..... Trailer file: ...
0
votes
0answers
14 views

Count total no of functions in .h files

I want to have a count of total exposed functions in my module? I tried grep -rn "(" *.h|wc -l but I am not getting exact answer How do I count total number of global functions in my module?
0
votes
0answers
17 views

Dual booting thwarted by rogue keyboard presses?

End goal: successfully dual boot Windows 8.1 and Ubuntu 14.04, both are already installed and working. I just can't get to the bootloader (I think it's called) to choose to go back to my Windows ...
0
votes
0answers
34 views

Shell script to check url

I am trying to write a shell script to check for the existence of a particular directory in a particular domain name. For example, I have a web site named www.example.com. I want to check whether the ...
0
votes
0answers
213 views

Using a samba path (smb://server/…) to check if a folder/file exists

I have a samba path, f.e. smb://server/path1/path2/ which is located when mounted at /var/run/user/1000/gvfs/smb-share:server=server,share=path1/path2/. I can easily check via filesystem path if the ...
0
votes
0answers
58 views

Comment text selection in Mousepad text editor?

Is there a keyboard shortcut, or a command, that I can use to comment a selection spanning multiple lines in Mousepad? This is language dependent, since comments in different programming languages ...
0
votes
0answers
129 views

Trying to debug a code, need some help!

so I'm trying to run an installer and I'm getting this message: $ ./install Preparing installation files ... Installing ... /tmp/mathworks_4504/sys/java/jre/glnxa64/jre/bin/java: 4: ...
0
votes
0answers
61 views

Shell script loop stops by itself

I have two script files like this. execute.sh #!/bin/bash #259200seconds = 5 days end=$((SECONDS+432000)) x=0 cp /dev/null ~/kill_start.txt while [ $SECONDS -lt $end ] do [[ $(cat ...
0
votes
0answers
17 views

SOHO Network Scripts

I have a trying to develop two simple scripts to automate the set up of a small office with a Ubuntu server and workstations. I am likely in way over my head, but I am trying to do it anyways. The ...
0
votes
0answers
32 views

Issue with running cgminer as a cron job - Ubuntu

I have installed cgminer in my machine and could able to start it without any issues when running ./cgminer in terminal. But for a specific feature, i am trying to invoke the cgminer from using ...
0
votes
0answers
63 views

switching kde activities in command line

I started taking a course on bash scripting, and i'm still a newbie in bash scripting...please i wan't to know whether it's possible to control and switch kde activities in kubuntu via the command ...
0
votes
0answers
202 views

unable to run script using “startup applications” option in ubuntu 14.04

I am trying to run following script to run my rails application on startup but unable to execute. run_my_app.sh #!/bin/bash cd /home/<user>/<my_rails_app> && rails server ...
0
votes
0answers
114 views

how to install ksymoops on Ubuntu 14.04

I want to analyze kernel crash(Oops) using ksymoops. I am trying to install ksymoops on Ubuntu 14.04(LTS) 64 bit using command sudo apt-get install ksymoops but unable to install. Below mentioned ...
0
votes
0answers
460 views

move files and auto rename if same name | bash script find all *.extension

Something like "--auto" in: http://doc.bazaar.canonical.com/beta/en/user-reference/mv-help.html It seems a bit complicated to --no-clobber (-n) and work on return codes if [ $? -eq 1 ];then ...
0
votes
0answers
54 views

reverse shell to ubuntu returns input as output

i start a reverse shell session from an an ubuntu 12.04 server to my host 12.04 desktop. the specific actions i take can be seen here: How to open reverse shell from NOWASP? but in a nut-shell, i ...
0
votes
0answers
54 views

How to open reverse shell from NOWASP?

I'm using 12.04 LTS and the server is 12.04 LTS server. So, I'm teaching myself some pen testing and right now I'm trying to use netcat to open a reverse shell from nowasp, my nowasp is on a VM and ...
0
votes
0answers
238 views

How to use Hadoop streaming input parameter for matlab shell script

Actually i want to execute my matlab code in hadoop streaming. My doubt is how to use hadoop streaming input parameter value for my matlab input. For example , This is my matlab file imreadtest.m ...
0
votes
0answers
24 views

Startup script for pxeboot

I am working on pxeboot. Now i want to do startup script in pxeboot server and whenever client started the startup script will run on the client machine. How to do that. ?
0
votes
0answers
33 views

Unmount partition from script, but keep desktop icon?

I dual boot Xubuntu 12.04 with Windows 8. I have a couple of games installed on the Windows side that also work well under Wine. I have a script that checks to see if the Windows partition is mounted ...
0
votes
0answers
43 views

How to “simply” execute commands when connected to a specific network without wicd if-up or cuttlefish

1) getting /etc/network/if-up is too complicated and just not working. I don't want to do it this way anyways. On Android I can do this simply with tasker. 2) cuttlefish would have been a good option ...
0
votes
0answers
86 views

Create new domain tools or script?

I'm new to *nix, Ubuntu, and nginx and so far it's a lot of fun playing around with new technology. However, after following tutorials on how to setup a new domain (server block) I can see how this ...
0
votes
0answers
49 views

Need a shell script to loop launching a connection to a thin client, waiting, logging off, then connecting to a windows 7vm

I'm very new to Ubuntu and I need to have a shell script to do what the title says. I used: xfreerdp -u [uname] -p [password] -o --plugin drdynvc --data rdpeusb -g 1280x1024 -- [vm's ip] to make ...
0
votes
0answers
107 views

iHeartRadio - Looping for changed Auth Code

I have a bash script I'm running that plays a station from iHeartRadio in the CLI. I also use it to record a show in the early morning on my RaspPI so I can listen later in the day. The script works ...
0
votes
0answers
131 views

Changing ESC to ALT-F4 While running sh script?

Is there anyway to change ESC to ALT-F4 while running a shell script that is run by Advanced Launcher(XBMC) it then runs Google-Chrome in kiosk mode? But since I am using a controller with limited ...