Script is series of instructions written in plain text file. The script interpreter (i.e. shell, Python, Ruby, etc.) can read this file and act on the instructions as if they were typed at the command prompt. The interpreter also provides a variety of useful programming features to make your scripts ...

learn more… | top users | synonyms (3)

5
votes
2answers
5k views

How to add a script to command list [duplicate]

I am using sage a math library in python. After downloading its package, I usually have to go to the directory where I extracted it and then run the the script using sudo ./sage from terminal. How ...
2
votes
1answer
548 views

A simple email autoresponder

I have a POP3 email account, that I do not use anymore. It is on a server out of my control. Several of my contacts keep on sending email to that address, though I told them. So I decided to set an ...
3
votes
1answer
4k views

Configuring syslog for bash script logging

I want to use syslog to do some bash script logging. I see /etc/rsyslog.d/50-default.conf, but I'm new to syslog. I want to configure local0 for logging for my scripts. Should I be editing this ...
8
votes
3answers
4k views

how to detect a file over internet using ping or similar command?

I have a shell script to download some of my stuff over Internet. How can I know if a file exists over the Internet? Let's say I want to know if http://192.168.1.1/backup/01012011.zip exists or not? ...
15
votes
2answers
2k 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 ...
10
votes
2answers
3k 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 ...
18
votes
3answers
1k views

How can I initiate Nautilus file operations from the command line?

How can I start Nautilus's "File Operations" GUI from the command line? My goal is to include this in a Nautilus script.
4
votes
4answers
5k views

Upstart script for a transmission-daemon executed as a normal user

I have done a script to start transmission-daemon as a normal user: start on filesystem stop on runlevel [!2345] respawn respawn limit 10 5 pre-start script test -x /usr/bin/transmission-daemon ...
9
votes
1answer
1k views

Script using sed adds an “e” to the output files

I have a script that adds a new user and creates a virtual host for the users domain name. The script works great with one exception... in /etc/apache2/sites-available/ all of my virtual host files ...
4
votes
3answers
3k views

How to associate all file types within Wine with its corresponding native application?

This is easily done for a single file type, as answered in How to associate a file type within Wine with a native application?, by creating a .reg for the desired filetype. But this is for AVI only. I ...
4
votes
1answer
2k views

Starting a service from /etc/event.d works, but not from /etc/init

I'm trying to launch an upstart service on Ubuntu 8.04 from /etc/init/, but I always get start: Unknown job: job. When I try to launch this script from /etc/event.d/ it works fine. Why would this be ...
0
votes
1answer
454 views

Lua or Ruby (or something else?) for scripting?

I'm making a program in Java and I'm choosing a language for scripting. I'm aiming for speed and for being easy to learn/code for a java program. (So what I mean by Ruby and Lua is JRuby or LuaJ or ...
1
vote
2answers
1k views

can't run this shell script

So I'm trying to install this script I do copy the folder in ~/Documents/icambridge-get-sh1t-done-1222b6b change .bashrc (the one in the user directory, is that the right one?) by adding a line ...
15
votes
1answer
3k 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 ...
1
vote
3answers
6k views

Simple script - execute command on selected file

I want to make a script that will execute .jar file on selected file. Later I will add that script to right-click menu via the tool Nautilus Actions or just place it into nautilus-scripts folder. I ...
3
votes
3answers
1k 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 ...
2
votes
1answer
2k views

how to read init.d script start argument

In reference to the following documentation, how can i read the start and stop argument? I want to tell if the computer is booting up or shutting down so that i can run the correct script. To make ...
9
votes
4answers
5k views

Script for opening tabs in Guake terminal

I am using this script with gnome terminal: #!/bin/sh gnome-terminal --tab --title="1" --command="ssh 1" \ --tab --title="2" --command="ssh 2" \ --tab --title="3" --command="ssh 3" \ --tab ...
5
votes
1answer
4k views

Start multiple apps running in shells split in one console

I need to start multiple apps running in shells and monitor their execution. Currently I have a main script that launches every apps in a new gnome-console but I would prefer to launch them all in the ...
1
vote
1answer
421 views

Enabling Compiz “Extra” or “Normal” effects per bash in Ubuntu

Enabling disabling compiz per bash is pretty simple per compiz --replace, But how can I switch between the None / Normal / Extra -- Visual Effects in the "gnome-appearance-properties" only using a ...
4
votes
2answers
4k views

How to configure Shutdown tasks?

I have a shell script I'd like to run automatically every time I logout, shutdown or reboot. Does anyone know where can I configure this in Ubuntu 10.10?
6
votes
3answers
868 views

directory name with space and bash

I'd like to exclude the directories "temp" and "Ubuntu One/" from backup. What is the correct escaping of the space???? RSYNCCONF="--delete --exclude=.* --exclude=temp/" Thanks in advance! Chris ...
9
votes
1answer
6k 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 ...
2
votes
4answers
432 views

Reorder Files inside Folder

I have about 30K songs in mp3. I already organized/tagged them with Musicbrainz Picard. But Picard made an excess of folders and subfolders inside each other because of the tags. What I need now is a ...
2
votes
1answer
763 views

Reconnecting to a PPP connection on a Verizon Wireless Modem

OK, I have a shell application running on Ubuntu 11.04 which must use a Verizon Wireless Modem to stay connected. I can't figure out how to invoke this application from the shell, but can do so from ...
7
votes
4answers
35k views

Is it possible to pass passwords on a shell script?

Long time i am searching for this, i would like to know is it possible to pass passwords in a shell script? Many of the answers returned with no. Recently i read an article stating that how to pass ...
43
votes
4answers
114k 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. ...
1
vote
1answer
746 views

Nautilus Open in Remote Terminal

As I already wrote, open-in-erminal package does not work for remote hosts for me Nautilus "open in remote teminal" fails after login. So I decided to try to write my own script to do same ...
3
votes
1answer
881 views

Need software to track login and logoff timings

I am in a need of software which can track login and logoff timings on user basis. If possible, software should be cross platform. If you know such software, please share.
3
votes
3answers
4k views

How to run a program for a fixed period of time?

I am looking for a method built-in to ubuntu that will allow me to run a script or program or whatever for a fixed period of time. I found a program that does this in a way I like, but the package is ...
1
vote
1answer
919 views

Display number of hours since a specific time in bash

I have a command that outputs a single date in whatever format I please. Now I need a simple way of calculating (with bash) how many hours have passed since that date (default is yyyy-mm-dd hh:mm). ...
1
vote
2answers
994 views

Auto copy files when added to network share

I have a network share on my system to which our plotter scanner sends its scanned files. How can I write a script to automatically copy newly added files to another folder?
0
votes
2answers
2k views

Shell Script to install software & configure network

Hey, I wanted to know, how to, after a fresh install of Ubuntu, I can install all essential softwares(vlc, apache, MySQL, PHP, java, Netbeansetc) using a shell script. Also I wanted that same shell ...
2
votes
4answers
4k views

how to run a function as root in shell script

exactly i want to make a script and add this to shortcut launcher... when i double click the icon, it will popup a terminal window (done) in terminal, it will ask root password at first.. and then do ...
4
votes
1answer
1k views

How can I get a set of files into the Zeitgeist index for dash access?

I understand, based on a number of other sources, that files will not appear in a dash search until they have been opened, due to the search drawing from zeitgeist. As an example, this is ...
4
votes
1answer
3k views

How to use a zenity progress bar with cclive

I tried to use a zenity progress bar with cclive. I'm writting a script to download web videos files and I wanna see the progression of the download. But when I try something like $cclive ...
1
vote
3answers
351 views

Using variables from a text file in Scripting

I'd like to use a command line program (specifically geotifcp) which takes file_a.tif and file_a.tfw and outputs file_b.tif. Basically it combines two files of the same name with different file ...
7
votes
1answer
4k views

Bypass “Do you want to…” dialog after clicking script

After I create a bash script and double click it in Nautilus I am prompted with this - Do you want to run "sleepytime", or display its contents? With Run in terminal, Dislpay, Cancel and Run as ...
1
vote
1answer
1k views

How to open a file in gedit with zenity --file-selection as root

I try to open a file in gedit with the file-selection option of zenity. It's very easy to do it for file that i can access in normal mode, but I wanna open too some configuration files (as for exemple ...
5
votes
2answers
13k views

bash: [: too many arguments?

I'm trying to create a directory and cd into it: In ~/.bashrc: function abc() { appname=$1 appdir="$HOME/code/$appname" if [ mkdir $appdir -a cd $appdir ]; then echo Success else ...
1
vote
3answers
5k views

SFTP upload script, there is no key

I need to upload a file to a server. The server uploads using SFTP. After authentication, any command execution is forbidden, so I cannot SSH directly in, I need to get directly into the SFTP ...
19
votes
3answers
37k views

At what time does cron execute daily scripts?

If I place a shell script in /etc/cron.daily/, at what time of the day will it be executed?
4
votes
0answers
948 views

Run script AFTER automounting usb hdd (udev, mount --bind) [duplicate]

Possible Duplicate: How to run a script when a distinct flash-drive is mounted? When plugging-in my USB HDD, it is mounted automatically, as expected. After that event, I'd like to ...
3
votes
2answers
2k views

How can I change the user during a bash script execution?

I have written a bash script from which i execute it from the root. I want to execute a particular command in a user account rather than root account.So how to execute that command in a user account ...
2
votes
1answer
5k views

How do I run BleachBit from the terminal?

On their website, they say to simply enter bleachbit --(argument here) but all that does is open the program. Am I doing something wrong?
0
votes
1answer
231 views

Link button to script

I'm trying to link a button(now without function) to a script that I have made. I'm using a notebook with several extra buttons This button however is like the power on button, it stands by itself ...
3
votes
1answer
2k views

Setting the owner of the file created by start-stop-daemon output redirection

I have the following line in do_start() of my custom init script that starts a java application: start-stop-daemon --background --start --quiet --oknodo --make-pidfile --pidfile $PIDFILE --chdir ...
3
votes
3answers
2k views

How to copy files to multiple hosts across the network?

I have more than 200 Ubuntu systems to which I want to copy a file. How can I copy files to multiple hosts across the network? What possibilities do I have? Note: This question is related to How to ...
11
votes
7answers
7k views

How to remove Change Desktop Background from right click?

I want to restrict users on changing wallpapers and themes. So can anyone say me how to remove Change Desktop Background option from right click? Note: I just totally want to remove that option ...
5
votes
1answer
804 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 ...