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

learn more… | top users | synonyms (1)

15
votes
5answers
22k views

How do I tell a start up program to start minimized?

Here is a quesion that has been bugging me. You know how you can set up a program to run on start up right? Well, how can i tell it to start minimized, like you would do in windows? TeamViewer ...
36
votes
5answers
6k views

How do I create a deb package for a single python script?

I have a single python script that I want to distribute as a deb package. It is a indicator which shows local date in Unity panel. I did follow create a .deb Package from scripts or binaries but I ...
5
votes
2answers
853 views

Autorun a script after I plugged or unplugged a USB device

What can I do to run automatically a script after I mount/plugin or unmount/unplug a USB device?
7
votes
2answers
4k views

Apply icons to bash scripts

I created a script for XChat according to this answer, and I was wondering if there is anyway to apply XChat icon to it.
28
votes
3answers
5k views

How to make Skype use notify-osd?

How do I make Skype use the default Ubuntu notify-osd to display notifications (incoming messages, users connecting, etc.) instead of the Skype's own "ugly" message box?
15
votes
5answers
24k views

How can I make a script that opens terminal windows and executes commands in them?

I have three scripts I need to run when I start up my Ubuntu machine, they start services I use in my development environment. To do that, I manually open three terminals and type in the commands. ...
6
votes
3answers
6k views

How to run a script during boot as root

I had a script that automatically enables my wifi without using networkmanager, but I don't know how to run the script as root while the system is booting. How do I make the script run automatically ...
45
votes
3answers
2k views

Is #!/bin/sh read by the interpreter?

In bash or sh, I guess anything which starts with # is a comment. But in bash scripts we write: #!/bin/bash And in Python scripts, there is: #!/bin/python Does this mean that # by itself is a ...
18
votes
2answers
40k views

How to add a shell script to launcher as shortcut [duplicate]

Possible Duplicate: How can I edit/create new launcher items in Unity by hand? How can I create launchers on my desktop? I want to add some shell scripts in my launcher as shortcuts.. ...
16
votes
1answer
7k views

how to execute a command after resume from suspend?

I've got a script that is executed in order to have suspending/resuming working in my laptop. Then I have another series of xinput,xkbset and xmodmap commands that are executed when I initiate a ...
6
votes
3answers
4k views

Launch an application in Windows from the Ubuntu desktop

I'd like a write a shell script in Ubuntu that does the following: Boot up a Windows 7 guest OS in Virtualbox, if it isn't running already. Run a shell script in Windows, where the shell script is ...
4
votes
2answers
3k views

Execute a script upon logout/reboot/shutdown in Ubuntu

I'd like to run a .sh file using bash on logout and shutdown of Ubuntu. I have searched up and down the web and have found only fixes for KDE and GNOME. The script is simple, I just need to know if I ...
2
votes
2answers
181 views

Script to Notify me when something happens on a shared directory

The situation is: I have a shared directories from many other machines where other users work on. I need to be notified whenever a user create, modify or delete a directory or file from his local ...
8
votes
2answers
11k views

Why doesn't rc.local run all my commands, and what can I do about it?

I have the following rc.local script: #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # ...
3
votes
3answers
873 views

Script at Startup

I'm using 10.10 and I need to run a script in order to get a windows-like international keyboard layout - basically, it changes how dead keys work. (Original script from this page ...
31
votes
2answers
5k views

bashrc or bash_profile?

I know the difference between the two bash login scripts: .bashrc is run only by "non-login" shells. .bash_profile (or .bash_login or .profile) is executed by "login" shells. Does anyone have some ...
11
votes
3answers
65k views

How can I make “rc.local” run on startup?

I have a script that I would like to run when my system starts. I have put it on "rc.local", but it doesn't work. How can I enable it to run on startup? Thanks!
16
votes
5answers
19k views

How to execute a script just by double clicking like .EXE files in Windows?

How can I make a bash script executable by double clicking just like .exe files in Windows? I tried creating a launcher and assigning the script to it, but there are two consequences: the terminal ...
16
votes
5answers
9k views

Execute script before shutting down

When I shut down my computer I want to show some pending tasks that I have to do before leaving the office... I did a local application to manage those tasks, basically I just want to run a command, ...
13
votes
1answer
2k views

How to run a shell script when a new USB storage device is detected?

I want a script that dumps the log and starts logging on it as soon as a usb mass storage is plugged (with the file 'OKdump' on it).And if anything abnormal(Like a error that is visually present) is ...
6
votes
3answers
6k views

Run (system) script on SSH login and/or logout

I'd like my OpenSSH server to start a script whenever a user logs in using SSH, ideally passing the host name or IP, as well as the user name. Additionally I'd like it to run a script, whenever a ...
9
votes
2answers
1k views

What is the least insecure way to store a password that is used by a script?

I have a Bash script that automatically authenticates with a service using my username and password. The credentials are currently stored as plain text within the script. What precautions should I ...
12
votes
1answer
1k views

What is apt-fast and should I use it?

Several times over the past couple years, I've heard of people using apt-fast for updating and installing packages, but I'm not really sure what it does. I think I've traced its origin to this forum ...
3
votes
1answer
284 views

How to emulate pressing the Close button from a script?

I wanted Thunderbird to stay in the Background to notify me of incoming mails. After a bit of searching, I found this post. How to keep Thunderbird and Pidgin running on background? The solution is ...
2
votes
3answers
85 views

Create a .desktop file that opens and execute a command in a terminal

I would like to know how to write the Exec command of a .desktop file to open a new terminal and execute a shell script in it. The shell script is working and accessible by all users. When launching ...
1
vote
2answers
2k views

Transmission shutdown script for multiple torrents?

I have written a shutdown script for transmission. Transmission calls the script after a torrent download finishes. The script runs perfectly on my machine (Ubuntu 11.04 & 12.04). #!/bin/bash ...
1
vote
5answers
5k views

How to batch rename files with “variables”?

I use xmbc to view my tv shows. Before I began using xmbc, I batch downloaded the first few seasons of "Bleach". What can I say, I'm an anime fan ;-). These are named: "bleachxx.mp4" where xx is the ...
45
votes
1answer
4k views

Can I make the webcam take a picture when an incorrect password is entered?

I am using a laptop . I was thinking to have a support in my Ubuntu machine. When an incorrect password is entered, a picture is taken later revealing who has been trying to gain access. I have ...
24
votes
8answers
2k views

How to keep “dot files” under version control?

Etckeeper is a great tool for keeping track of changes to your configuration files in /etc A few key things about it really stand out. It can be used with a wide variety of VCSs: git, mercurial, ...
28
votes
2answers
49k views

What is difference between /bin/sh and /bin/bash?

if I write, #!/bin/bash echo "foo" or #!/bin/sh echo "foo" both yields same. I have seen some scripts starting with #!/bin/sh or #!/bin/bash. Is there any difference between them?
17
votes
5answers
16k views

Beep in shell script not working?

I'd like to use a beep sound in a shell script. Unfortunately none of the methods I found via Google work for me. I tried echo -e '\a' echo -ne '\007' and the command beep after I installed it ...
39
votes
3answers
8k views

How can I determine whether a shellscript runs as root or not? [duplicate]

Possible Duplicate: How can a script check if it’s being run as root? This is something I've been curious about. I make a lot of small bash scripts (.sh files) to do tasks that I routinely ...
33
votes
2answers
9k views

What is the difference between “source” and “.” in bash?

As the question says, what is the difference between executing a script with source command and with . , i.e.: source /some/script and . /some/script
14
votes
2answers
2k views

How can I write Nautilus scripts in Python?

I want to write a Nautilus script in Python. Is that possible? If it is possible, how can I do that?
17
votes
9answers
63k views

How can I create a select menu in a shell script? [closed]

I'm creating a simple bash script and I want to create a select menu in it, like this: ./script echo "Choose your option:" 1) Option 1 2) Option 2 3) Option 3 4) Quit And according to user's ...
7
votes
5answers
541 views

Generating an app list from the old installation to run it on the new installation

I want to shift from ubuntu-desktop 10.10 to ubuntu netbook edition 10.10 on my netbook. Currently, the moment I ssh into ubuntu from my ad-hoc network, ubuntu freezes. It always requires a cold ...
7
votes
2answers
1k views

Getting a script to run on boot, not on login

How can I get a specific script to run (preferably not as superuser) whenever the machine boots, but before login. It can be the last thing to run on boot. I mostly just want the script to work even ...
6
votes
1answer
3k views

How do I make post-install scripts?

How do I make post-install scripts so when I reinstall ubuntu everything is as I want it? Things I want to achive: Installing PPA installing my programs themes needs to be installed Settings needs ...
15
votes
3answers
5k views

How can a script check if it's being run as root?

I'm writing a simple bash script, but I need it to check whether it's being run as root or not. I know there's probably a very simple way to do that, but I have no idea how. Just to be clear: What's ...
13
votes
5answers
12k views

How to start a terminal with certain text already input on the command-line?

Rather than rephrasing my question, let me describe to you the desired user-case: I create a short shell-script to run command "gnome-terminal --someoptionflagname 'my text to be posted'", and ...
6
votes
1answer
3k views

How to automatically install entire Google Web Fonts collection?

I'm basically looking for an unattended way to deploy/install the Google Web Fonts collection into several Ubuntu boxes. I've searched for PPAs, packages or user scripts but without much luck. Any ...
5
votes
2answers
602 views

How do the environments of a standard Terminal command-line and a bash script differ?

I know there is something different about the environment of the Terminal command-line and the environment in a bash script, but I don't know what that difference is... Here is the example which ...
4
votes
1answer
685 views

How to run a custom set of programs in a specific workspace?

I use several workspaces in order to have different context for different works. Therefore, I run the same set of applications in the same workspace repeatedly. And also I run the same application in ...
11
votes
2answers
32k views

How do I run a script after OpenVPN has connected successfully?

How can I associate a script to OpenVPN so that it runs when the VPN is connected successfully?
7
votes
5answers
3k views

Command line archive manager / extracter

I keep forgetting all the corresponding extract commands for every compression format. So I was thinking about writing a script that merely maps file extensions to the appropriate extract command. ...
3
votes
2answers
20k views

Run shell script on startup or boot

My problem in a nutshell is that I have to run a script every time I use my computer so I'm trying to automate the process a bit. My system has the nvidia gt540m vga card. The card is dual. It has ...
1
vote
2answers
139 views

Copy “string” through command line

Can we copy a string with a command-line and have the ability of pasting it with Ctrl + V shortcut?
1
vote
1answer
784 views

How to reboot using an updated kernel with kexec?

Is it possible to reload the kernel using kexec after a kernel upgrade without doing a complete reboot? The Ubuntu wiki RapidReboot page explains how to perform that using init.d commads, any fast way ...
4
votes
3answers
15k views

Run a script on login using ~/.bash_login

I need to run a script when I login and logout in my Ubuntu. I tried to put the script in my ~/.bash_login but it didn't work. Is there a better location where I can run my script? My script is ...
2
votes
3answers
280 views

How can I run this sh script without typing the full path?

I'm still very new to Ubuntu. I'm using 12.04, and I'd like to know if there is a way to run this program/shell script without typing: /opt/idea/bin/idea.sh It's kinda tedious and I'm quite lazy. ...