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

learn more… | top users | synonyms (1)

22
votes
3answers
1k 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
123 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
134 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
412 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
145 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
70 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
208 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
43 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
67 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
95 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
102 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
80 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
110 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
74 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 ...
0
votes
0answers
22 views

Send invites email to people in this file

For example we have a file and in this file we have email addresses to some people. Is it possible to make script which will take this file and mail to all people in this file and with info about ...
0
votes
0answers
21 views

Only part of my startup script gets executed

I have a script located under /etc/profile.d that executes when I login via the gui. All I need this script to do is connect to my pptp server with a single command which runs flawlessely when I ...
1
vote
1answer
478 views

How do I write a script to output an html file?

What am I doing wrong in this script? #!/bin/bash cat > /tmp/flash-viewer.htm <<- _EOF_ <HTML><HEAD><TITLE>Flash Viewer</TITLE></HEAD><BODY> <object ...
1
vote
3answers
318 views

Python command in bash does not find -c flag

I have two python lines in my bash script, both should run with -c flag, but once I run the Bash script it tells me that it could not find -c flag that is needed for python to run the command in Bash. ...
2
votes
1answer
44 views

How to run scripts as user (not as root) in lightdm?

I want to run some scripts before login every time my PC is started. I add the scripts in as greeter-setup-script in lightdm.conf. However, all the scripts are running as root! I want to use normal ...
0
votes
0answers
45 views

Bash if password filled save it

I am trying to save a password to gnome keyring via python script. The python script will be runned from bash script if password is filled in zenity GUI. Example: User inserts hes/hers password to ...
2
votes
0answers
67 views

Startup script to unmount and re-mount a USB device

I have a Microsoft wireless mouse and it has a scrolling issue in Ubuntu. The scrolling is too sensitive. I've read in other threads that the solution to this is unplugging the USB receiver of the ...
2
votes
1answer
58 views

How to refresh privileges on a script?

I have an script that modify files and group permissions. But it doesn't bring effects 'till I close the session and open a new one. Instructions where permissions are changed: sudo groupadd ...
0
votes
1answer
210 views

How to debug initramfs scripts?

For my Ubuntu 14.04 setup, I have 4 LUKS partitions that work as backing block devices form my BTRFS root partition. Using the default settings I could not get the 4 encrypted partitions unlocked at ...
0
votes
2answers
52 views

How to list directory contents recursively? [closed]

I need help with a script that displays the subdirectory structure of the current directory, along with the names of files in these subdirectories. I've tried commands tree, ls, and grep but it is ...
3
votes
2answers
4k views

Unable to execute .sh files in Ubuntu 14.04

I am unable to run .sh file in Ubuntu 14.04. The same file was executing in earlier version 12.xx. After upgrading to 14.04, this file stopped running. How to resolve this issue?
0
votes
1answer
103 views

How to launch .sh from third party program?

I have the program Lutris installed on my computer and I am going through adding all my linux games. However some are .sh execs others are .bins and executables which both added fine. the .sh ones are ...
0
votes
3answers
44 views

Append an output of a command to a txt file and place it in non writable directory?

If i try for example : directory A i don't have write permission on it sudo ls -l > /home/A/a.txt bash: /home/A/a.txt: Permission denied Then how can i do this trick , any Suggestion is ...
1
vote
0answers
135 views

Can you use gnome keyring in bash script, if yes then how?

I am developing a automated mounting script for Windows shares. I have finished the script and it works just fine, but is it possible to add Gnome Keyring to the bash so once user writes hes/hers ...
2
votes
2answers
343 views

Bash login script with zenity for CIFS mount

I am writing a mount script for Windows share to run after login. I have done it with bash and zenity and it works, but now I need to make it better so if username field and password field are empty ...
0
votes
0answers
207 views

Installing packages (using Synaptic) failing

I am trying to (re)install sfcb using the Synaptic Package Manager. When I do so I get: (synaptic:3969): GLib-CRITICAL **: g_child_watch_add_full: assertion 'pid > 0' failed (Reading database ... ...
1
vote
2answers
121 views

Autorun windows share mount script after login as root

I have looked everywhere for a solution that lets me run CIFS automount script after login with around 20 second delay. What I have tried. Added the script to visudo: rait ALL=(ALL) NOPASSWD: ...
1
vote
2answers
174 views

How to install RevKit

I’m trying to install a software called RevKit on Ubuntu 12.10 and the following instructions1 need to be followed: RevKit can be downloaded from the www.revkit.org website. Opening a Bash ...
0
votes
1answer
324 views

.sh installation error, this script is to be run as resolve user

Ubuntu 14.04 64 bit. I downloaded a .sh file that is supposed to install Davinci resolve but when i run it it says uncompressing installation package, and then says this script is supposed to be run ...
23
votes
3answers
2k views

Where should I put my script so that I can run it by a direct command?

Where can (should) I put my (bash) script so that it can be used (forever) by terminal or by a direct command: Alt+F2? I know there is /usr/bin and /sbin & /bindirectories but when should I use ...
1
vote
0answers
55 views

Using a keyboard shortcut to execute a script

Hello I am a linux newbie trying to set up a keyboard shortcut to execute a script I have. The script functions as desired, and is #!/bin/bash livestreamer twitch.tv/arteezy best This opens up ...
0
votes
0answers
111 views

init service script is running twice

I have a init script under /etc/init/ to start up an application server. The problem is that it seems to be running twice. here is the command: exec su - deployer -c 'cd /home/deployer/app/current; ...
0
votes
0answers
17 views

Why is inserted media loaded under user directory? [duplicate]

case in point: I insert an SD card named TESTSD into my computer, It loads to /media/user/TESTSD instead of /media/TESTSD So far this only happened on two installs on different machines with Xubuntu ...
1
vote
0answers
29 views

Automatically detecting and outputing to s-video at startup

After combing the Internet I have developed a script that is capable of checking whether I have a monitor connected to my VGA port and switching to my s-video port if not #!/bin/bash # if no vga then ...