Tagged Questions

A shell script is a script written for the shell, or command line interpreter, of an operating system.

learn more… | top users | synonyms (1)

1
vote
1answer
49 views

Pass variables to script which called script

I have a bash script which must call another bash script which varies per-user in order to get some configuration information, like so: somescript: #!/bin/bash ${HOME}/.ssconfig echo "Hello, ...
0
votes
1answer
38 views

In this script, ~ is /root/. How to be in /home/name-of-the-user/?

#!/bin/bash #become root UID=$(id -u) if [ x$UID != x0 ] then printf -v cmd_str '%q ' "$0" "$@" exec sudo su -c "$cmd_str" fi mkdir ~/.D3GO/; cp -a `pwd`/viewright_backup/. ~/.D3GO/; ...
0
votes
2answers
24 views

How to make a script that will make another script in the same folder executable?

How to make a script that will make another script in the same folder executable? I don't want to worry about path since it will be in the same directory. So it should be something like(i'm trying to ...
1
vote
1answer
32 views

Launch app with absolute path does not woks

I'm quite new in Linux environments, but for this one, I need help on bash. I'm on Kubuntu 14.04 x64 I have an embedded JRE for my business application , placed like this: app_root/run.sh (my ...
2
votes
1answer
159 views

How to write a script to run different application

I am very new to linux platform. Looking for a script file to call different application start up file located in different location and needs to be run in different terminals. For example : i ...
0
votes
1answer
207 views

How to open a bash script in Terminator using a command line?

so basically I have a program called Terminator and I want to open a .sh script, however, I don't run to run it as root, I basically want to have Terminator run the script, using another command line, ...
1
vote
1answer
95 views

Run the script file after 5 or 10 min after restarting the system

I have created a ruby script file that checks the connection present or not. For example checking port 22 is opened or not. Firstly I tried with cron job as follows @reboot find ...
-1
votes
1answer
99 views

Why can't I update my system via shell script?

I have a very simple script, let's call it update.sh: #!/bin/bash echo "Updating system..." sudo apt-get udpate sudo apt-get udgrade Running this script, throws the following error: me@host $ ...
1
vote
4answers
185 views

How to make Start up script for Making Application run on startup

I have one jar which i need to run on startup and no matter whatever user is logged in and that need to take that user name automatcally here this code can take user name echo $(logname) and this ...
1
vote
2answers
105 views

Unable to run shell script inside VI/VIM

I am trying to run a shell-script say test from vim #!/bin/sh echo good morning Now when I am using :!% I am getting a pop like shell returned 1 Press ENTER or type command to continue instead ...
0
votes
1answer
38 views

Subshell in script wont print corectly

Why does my shell and subshell only print the first hour in my for loop? It's supposed to loop through all 24 hours in a day but only prints the first hour correctly. { for D in $(seq -f "%02g" 1 ...
2
votes
3answers
58 views

automate multiple file conversions

I need help fixing my script to automate multiple file conversions. I am working on the server and I am trying to find a way to convert files automatically. The conversion needs to be made through ...
0
votes
0answers
34 views

How do I start a tmux window on startup and execute a scrips

I would like to be able to start my server and have a detached tmux window with a script running. So then I can attach with ssh and be able to work with the script. Thanks, Anthony
0
votes
1answer
45 views

Multiple background scripts in one command

I can run three scripts at once like this: python script1.py ; python script2.py ; python script3.py But when I try to run them all in the background, like this: python script1.py & ; python ...
1
vote
0answers
103 views

How can I draw selection rectangle on screen for my script?

I am trying to make a simple screencasting bash script. I want to get screen selection coordinates by drawing a red rectangle with mouse. I can use xdotools to get coordinates but how can I draw ...
2
votes
2answers
367 views

Convert seconds since epoch to a human readable string

Command date +%s produces 1403568422. Is there an easy way to convert the 1403568422 to a human readable UTC timestamp? python -c "import datetime;print ...
2
votes
1answer
137 views

Trying to use GNU Parallel with sed

Why does this line do nothing? I'm trying to run a "sed" command in parallel and it outputs nothing to "standard.txt" $Filetemp = the file I'm stream editing standard.txt = the file I'm outputting ...
1
vote
2answers
144 views

How to execute a command several times in the terminal with/without a few minor changes?

Suppose that I want to execute the command ls ten times (despite of it being purposeless since it will only display the directory contents 10 times), is there an equivalent to writing the following: ...
1
vote
1answer
552 views

How do I write an iptables rule to limit Internet bandwidth usage of user or IP address

How do I control or limit Internet bandwidth usage of users/computer/IP address in network with the help of iptables rules? I have one static IP address which provides Internet (that is, WAN). I ...
6
votes
1answer
124 views

Create a script to open firefox with some google search term from terminal

Is there any way to create a script or a program that will open firefox, go onto google and search for the arguments passed to it ? So something like google How do I shoot web should open Firefox ...
-1
votes
1answer
112 views

getting festival to talk at start up ubuntu 14.04

using this script: week=$(date +”%A” ) day=$(date +”%e” ) echo hello $USER you are super awesome i am your processor | festival –tts echo today is $week $day | festival –tts echo have a nice day | ...
0
votes
2answers
74 views

script terminate

# Check if VPNC is already running, otherwise start it if ( ps -ef | grep -v grep | grep -v vpnc_ondemand | grep -v less | grep vpnc > /dev/null ) ; then echo "Shell script is already running ...
0
votes
1answer
30 views

Is there other way to get your DISPLAY env without using shell?

I have a script that will get executed by incrond when it sees changes in a watch dir. There is only a few env vars that are available in the script, the rest get cleared by incrond. So this becomes a ...
2
votes
2answers
128 views

Shell Scripting Function question

I have this code snippet I am working on for a small project I am doing: echo "Please enter SUID: "; read $uid uid_Assoc(){ arg1=$1 echo $1; } uid_Assoc Now to start, I would like ...
22
votes
3answers
2k views

Can I modify a bash script (.sh) file while it is running?

Suppose I have a script script.sh, which takes some time to execute. I execute it, ./script.sh. While it is running in a terminal window, I modify the file script.sh. Will this have any effect on the ...
0
votes
0answers
30 views

Is it possible to launch an application inside a Virtual Machine? [duplicate]

I am currently running Ubuntu 14.04 as my main OS, with a Windows 7 installation inside VirtualBox for things I just can't easily do on Ubuntu (like running Microsoft Office). Now I am wondering if ...
1
vote
1answer
134 views

Editing Gsettings unsuccesful when initiated from cron

I must have a blind spot, but I cannot find what it is. I made a small python script that removes VLC from the sound menu. It runs perfectly in any way I run it from the terminal or from a launcher ...
0
votes
0answers
35 views

getting error in opening py file [duplicate]

I'm installing a software in Ubuntu 12.04 and got the following error: http://paste.ubuntu.com/7638369/ server@ubuntu:~/Desktop/revkit-1.3$ ./tools/gui/gui.py Traceback (most recent call last): ...
-1
votes
1answer
139 views

execute script with sudo after login [duplicate]

i need to execute the following commands AFTER login. sudo hdparm -y /dev/disk/by-uuid/443AFBAD7FE50945 sudo hdparm -y /dev/disk/by-uuid/7ABB49654B799D40 (trying to edit rc.local does not work ...
0
votes
0answers
21 views

ubuntu 14.04 I want my computer to talk to me at startup [duplicate]

using Festival Jovie need a script to run at start up so computer will talk to me.
0
votes
0answers
14 views

How to Open Certain Extension with Python Script [duplicate]

I would like to set a python script as the default method for opening a certain type of file. Is there a way to do this? For example, take the files called special.abcdef. I'd like Ubuntu to always ...
0
votes
0answers
35 views

Disabling sticky edges for multiple users at one time

I am trying to disable sticky edges for multiple users across multiple machines. Currently I am using the following code in a script I use for setting up a new machine. dconf write ...
17
votes
3answers
3k views

Why doesn't “cd” work in a shell script?

What is wrong with this easy script? I just want to write an script which change my directory: A. I put below commands on the file witch its name is pathABC on the /home/alex directory, #!/bin/sh cd ...
0
votes
3answers
466 views

Run script full screen in terminal

How do I get a bash script to run in full screen when it's executed or how can I change the terminal size if I can't make it full screen?
0
votes
0answers
24 views

cron to email when a psql stops recording data

I have a PSQL setup and records data every 10 minute or less. The connection sometimes dies and it results is logging failure and I have no idea when that happens. I want to create a cron job to email ...
2
votes
0answers
45 views

Script Issue (Incrementation) [closed]

I'm writing a script in bash. My output down below is wrong. The test data I'm pulling from makes it so that all connections allowed and denied should be in time "00" yet for every day I crawl through ...
1
vote
1answer
84 views

How can I create a script that allows all users to change network connections?

I want to create a bash script to enable all users to connect to wireless networks. Following the instructions on this page, I can set that and it works. However, I want to be able to do this more ...
3
votes
2answers
152 views

Why does a bash-zenity script has that title on Unity Panel and that icon on Unity Launcher?

I have this small bash script which helps use Infinality font rendering options via a more user-friendly Zenity window: http://gnomefiles.org/content/show.php/Infinality+Style+Changer?content=161984 ...
0
votes
1answer
77 views

How to add a runonce startup script?

I'd like to add a runonce start-up script on Ubuntu which is expected to be run after the network interfaces have been initialized and before any user logs in. So which is the appropriate place to do ...
1
vote
1answer
218 views

bash script move file to folders based in name

I hope you can help me... I made a perl and bash script to make a backup of my firewalls and tranfers via tftp #!/bin/sh perl /deploy/scripts/backups/10.160.23.1.pl > /dev/null 2>&1 ...
0
votes
1answer
24 views

How to create a script to launch several emulated ROM inside a folder

I would like to create a script to run simultaneously all the N64 Roms that I put inside a folder, reading the names from a text file. Since now I did a script like this: cat ./listN64_full.txt | ...
2
votes
1answer
44 views

Perform some operation as soon as eth0 is up

I have to perform a routine which requires eth0 to be up. I have tried to put it into /etc/rc.local, anyway it could not be triggered as eth0 could have not been initialized yet. Is there a way to ...
0
votes
2answers
71 views

Redirecting output to std output or /dev/null depending on optional parameter

I have a script where you can run it just like this ./myscript and the output of some commands called inside the script are hidden, just like this: if mvn tomcat:deploy &> /dev/null; then ...
0
votes
1answer
102 views

Run scripts in background in TTY

There are quite a few questions asking what you can do to run a shell script in the background while not running the terminal. Most have advised to use nohup or disown. This might be a stupid ...
2
votes
1answer
107 views

How can I set Firefox settings with a bash scipt?

I would like to create a bash script that I can run on several computers that will set some basic preferences and bookmarks for Firefox (and possibly Google Chrome) on Ubuntu 12.04. I think user data ...
1
vote
2answers
85 views

Running shellscript with cronjob is making problems, executing manually not. Ideas?

I made a shell script called /home/root/cron_grads.sh (chmodded 755) on my server. In this directory are more grads-scripts like 500hPa_p0.gs (644). My main script creates a temporary file ...
7
votes
4answers
2k views

How to check the process is already running or not

I want to check the particular process in already running or not. I refereed this Q&A. But I didn't get any specific solution. Following is the example that I tried: I have created abc.sh file ...
0
votes
1answer
114 views

Bash script not adding variables to session [duplicate]

I have a bash script that I have added as a startup application. It does a bunch of exports and alias assignment. #! /bin/bash alias devhm='cd ${DEV_HOME}; ll'; alias wlhm='cd ${WL_HOME}; ll'; alias ...
1
vote
0answers
34 views

suppress all interaction while installing apt-fast

I want to ask whether there is any method to suppress any interaction while installing apt-fast using apt-get. I add the ppa source and then use the next command to install apt-fast: sudo apt-get -y ...
0
votes
1answer
75 views

Permission error trying this backup script

I am trying this Backup Shell Script from the server guide. Granted it's for my desktop running Xubuntu 14.04. The NFS is mounted and accessible. The script has been created and edited with the ...