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 (1)

0
votes
0answers
12 views

Execute script on power supply connected

I am looking for a method that will call a script when the power supply is connected, or the battery state becomes "Charging". I will not accept answers involving any type of cron or loops. I know ...
1
vote
1answer
12 views

Need script to display Usage message if non option is chosen from menu

I have managed to get my program to function fine except for posting a usage message should the user attempt a non-menu option. The message that should be displayed if the users enter an incorrect ...
6
votes
5answers
227 views

Exit terminal after running a bash script

I am trying to write a bash script to open certain files (mostly pdf files) using the gnome-open command. I also want the terminal to exit once it opens the pdf file. I have tried adding exit to the ...
2
votes
1answer
39 views

Why putting a script in /etc/cron.hourly is not working?

I put an executable script in /etc/cron.hourly, but that script didn't run every hour actually it never runs at all. Here is the script content: #!/bin/bash mplayer ~/Music/sfx_msg-highlight.wv &> ...
0
votes
0answers
15 views

How to run a script when a directory is changed by another user?

I know has been a bit of discussion about topics similar to this. But here is what I am basically trying to do. I have a watch directory called and whenever a file is added to that directory, I want ...
0
votes
0answers
6 views

Quick Webhost Script for LAMP - How do I import localhost for www.example.com?

I have the following script written: sudo apt-get update sudo apt-get install apache2 sudo apt-get install apache2 apache2-utils sudo service apache2 restart sudo apt-get install mysql-server ...
0
votes
1answer
12 views

having elevated priority and general @audio permssion in rc.local

I am trying to run jackd instance from /etc/rc.local (along with a few other applications) from a custom made init script. The system is ubuntustudio and I have setup everything to have elevated ...
5
votes
1answer
79 views

What do these commands from a shell script do?

I'm just starting to learn bash. I have the following script, and I would like to know what does the following commands do in order to start to understand a little bit this world. if [ ! -w "." ] ...
-1
votes
1answer
39 views

How to create logfile for a bash script?

I've written a bash script that runs multiple instances of a program and would like to write the entire output of the script to a logfile. I tried #!/bin/bash touch <.../somewhere/logfile.log> ...
1
vote
0answers
19 views

/usr/local/bin/apt-get script being completely ignored

I have added a script to /usr/local/bin/apt-get on an Ubuntu Trusty system which does some checking that is required before launching the "official" apt-get. For reasons I simply cannot comprehend ...
0
votes
1answer
31 views

If-then in script [closed]

When i use the if-then statement in my script to put a condition. the condition says "$1 should be between 33 and 70". Any idea how to do that?
0
votes
2answers
66 views

Enforce a shell script to execute a specific python version

Update. Changing the alias unfortunately does not work. I have changed the alias to alias python='/usr/bin/python2.7' however the shell script still runs the python script in 2.4.3. Muru - I am ...
1
vote
0answers
16 views

Running an Application (xrandr) Script on Startup [duplicate]

I'm running Lubuntu 14.10 with a dual-monitor setup. Since Ubuntu (and its derivatives) don't seem to like monitors with different resolutions (my laptop is 1280x800 and the monitor is 1366x768), I've ...
0
votes
0answers
11 views

upstart .conf script not running at startup

I have a .conf file I run at start up. This file runs a script file i have stored elsewhere. But it does not run. Its supposed to launch node.js and two tabs on firefox. When i launch firefox after ...
2
votes
3answers
149 views

Error when running script in bash

I wrote a script in bash to basically create aliases, but for any reason, it doesn't work in some cases. Here it's the code: #!/bin/bash #Script to create unique and permanent aliases _add_alias() { ...
1
vote
1answer
41 views

How to remove all lines in a file containing a string from another file

I want to remove all lines in a file containing a string from another file. So I don't want to remove the lines which are identical, there are none, but remove all lines if they share a string from ...
0
votes
1answer
24 views

How do I write an awk script that catch ping's time in seconds?

How can I make ping show ms and time in (seconds)? I found this script: $ ping google.com | awk 'BEGIN {FS="[=]|[ ]"} {print $11}' 16.8 16.8 15.7 18.8 How do I write an awk script which brings out ...
5
votes
3answers
214 views

Count down script is not working

I am trying to create a script that will count down to 0 from what ever number I give it. Below is my script and basically nothing happens, no error message, I merely get the standard command line ...
-1
votes
1answer
20 views

How to stop renaming a file which was already renamed using loop in shell script

I have a directory name dir1 containing another directories named 1,2,3,4,5. Now I want to rename directory 1 with 4, 2 => 5, 3 => 6, 4 => 5. but my problem is using mv command in shell script ...
-1
votes
1answer
14 views

different behavior of script when it runs on crontab

I'm trying to write a script that checks if mysql is running, and if not restart it... i get a script to run perfectly if is called manually from terminal, but when i added to crontab it outputs is ...
2
votes
1answer
29 views

sed to execute a command as replacement with substitution pattern as argument

I am trying to replace time in a log file by: cat mlog.log | sed -e "s/^[0-9\.]*/\$(date -d @&)/" Why it always first execute $(date -d $&) but not doing replacement at first and then ...
1
vote
3answers
34 views

Force “bad” (not 0) return code of terminal command?

I have a framework written in python, and for testing purposes I basically want to do a subprocess (aka shell call) ... that should simply come back with a RC != 0. I tried to invoke some non-existing ...
2
votes
3answers
123 views

How to run a bash script after 20 sec on Login?

I want to run a bash script like: #!/bin/bash echo 'cpu limit bomi player at 40%' cpulimit -v -e bomi -l 40 Just 20 seconds after Login into my user. Can you please help me to do that? ...
2
votes
2answers
28 views

Timing limiter for execution of commands in Bash/Shell Script

I have a shell script which looks like this: echo firstOutput read -s command0 command1a command1b command1c echo secondOutput command2 command1a, command1b, command1c are individual commands but ...
4
votes
3answers
264 views

improve bash script

I have a quad core desktop, and i wanted to know the average temprature according to sensors. so i wrote this bash 1 liner. echo `sensors -A | awk {'print $3'} | sed 's/+\|(crit\|0:\|°C//g'` | awk ...
3
votes
1answer
44 views

Create zip files in /var/www/html using crontabs

As the title explains, I'd need to take a file and put it into a zip archive once a day; also, the zip file has to be moved in /var/www/html, where a .php scripts allow users to download it. Assuming ...
1
vote
0answers
33 views

Bash script: command not found

I have an executable script install_packages.sh in /home/etienne/admin folder. The directory's path is added to $PATH variable from /etc/bash.bashrc. When I type #echo $PATH I see that the variable ...
0
votes
0answers
24 views

An Nmap Script and Crontab

I have created a script that will run an Nmap scan, then go through the results and see what is different from past results. Then email the differences. I have been trying to get it to run ...
0
votes
0answers
17 views

How to install firefox addon Skip Cert Error silently through automation

I want to install firefox addon Skip Cert Error to skip ssl error for my automation projects running on Linux virtual hosts. However, I want this installation of add-on to be unattended through some ...
0
votes
2answers
37 views

when ssh is run with a server + command argument, what startup profile runs if any?

I know /etc/profile and ~/.profile are among the start-up scripts used when ssh is used to login to a server – i. e. using ssh with server argument. However, the scenario where I am just using ssh ...
1
vote
2answers
36 views

Writing script for automatic process

My shell is bash and I need to write a script that runs a specific software for each input data in the several folders. For example: gd2p.pl -i /home/WORKDIR/folder1/input1.o Let's say that I have ...
0
votes
1answer
38 views

Alsa unsupported soundcard

I am fairly new to Ubuntu and could really do with some tips, right here is what I want done Bus 003 Device 005: ID 200c:100a Reloop ^the above is my unsupported sound card listed in #lsusb ( ...
16
votes
2answers
349 views

Using “while read…” in a linux script

Could somebody please explain how the following code works? echo '1 2 3 4 5 6' | while read a b c do echo $c $b $a done` Specifically, I'd like to know why the output of this loop is 3 4 5 6 2 ...
0
votes
1answer
17 views

g++ command not found in sh script

I don't know, maybe this is a duplicate, but I didn't find any help. So, the problem. I have a simple problem - I made a script to automate C++ compiling a bit. Well, there's the script. #!/bin/bash ...
1
vote
1answer
30 views

Error: object “ip” is unknown , try “ip help”

I am trying to run trusted executables through a script. I copied the binary executable /bin/ip to a directory called Tools. I renamed the binary to eip. I have navigated to the directory tools and ...
0
votes
2answers
30 views

Create a dir on scratch with same name as in pwd directory

HI I try to simplify my problem, I'm trying to write a bash script, which can take the actual directory name (just like you get by statement "basename" ) and create a same directory on scratch. ...
0
votes
1answer
70 views

syntax error near unexpected token newline' doctype html ' while installing zpanel

I am new to ubuntu, trying to install zpanel on my VPS server. Found some questions with same problem, but none of them was applicable in my case. I have followed this answer to install zpanel, ...
0
votes
3answers
52 views

How to add executable bash script on ubuntu startup

I have created a executable bash script (using chmod +x) for monitoring my system and it works perfectly with out any error. Now i want to add this script on my start up in order to executing the ...
0
votes
0answers
28 views

sed error Bash script

So here's the deal I'm trying to do some auto editing of a file with sed in a bash script. Here's my code: systemdate=$(date) sudo mkdir "/tmp/autoupdate" sudo echo "$systemdate" > ...
0
votes
1answer
27 views

How to execute a script from trusted shell

I am new to Linux. I have copied the bash program from bin to a thumb drive. I have renamed it to "ebash". Now I connect this thumb drive to other Linux machine. I have mounted this drive and ...
1
vote
1answer
44 views

How to get notified (run script) on every SSH connection?

I'm able to run a script automatically every time I log into my machine via SSH by placing a command in the /etc/ssh/sshrc file. That works perfectly, however it's only triggered when I log in via ...
1
vote
2answers
132 views

awk to compare two files, extract, output to third [closed]

I've written a script in Python, but it's not fast enough for this job. I'm thinking line-by-line processing would work better. I have two files with two columns and potentially hundreds of millions ...
0
votes
1answer
37 views

Packaging bash script with dh-make

I have installed dh-make by installing other packages as recommended by this page which depend on it (I am listing all packages which could have installed it as well because I am not certain which one ...
0
votes
1answer
46 views

shell script for wifi connection via terminal

How to write shell script that will automate interactive steps to connect to wifi via terminal? Steps outlined in How do I connect to a WPA wifi network using the command line? with further details: ...
0
votes
0answers
19 views

Unable to run red.cc file with my tcl script in ns2.35

This is my Tcl script set val(chan) Channel/WirelessChannel set val(prop) Propagation/TwoRayGround set val(netif) Phy/WirelessPhy set val(mac) ...
0
votes
2answers
28 views

Bash “move files” error message

I am trying to move some files based on a search pattern using bash but I get an error message. Here is the borrowed script format I used and the error message. Thanks! #!/bin/bash firstdir=dir1 ...
0
votes
1answer
34 views

How to rebuild my PATH in script?

I have extracted my PATH to a file and listed it as such: /bin /usr/bin /usr/local/bin . /usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin /usr/java/default/bin /usr/kerberos/bin /usr/local/bin ...
1
vote
2answers
40 views

Script or program to log the disk usage

I would like either a program or more preferably a way to log the disk usage. In order to explain what I mean, when someone installs Ubuntu there are approximately 4.5 GB of disk used. Then when you ...
11
votes
1answer
166 views

Workspace Stopwatch?

Is there a program that can serve as a workspace-depended stopwatch? I'd like to know how much time I've spent in each workspace every day. Edit: I'm using Unity.
1
vote
0answers
26 views

How do I run as bash script from a WebApp?

I currently am developing a custom Ubuntu dist. that runs a dedicated Kiosk app upon boot. I would like an easy method to shutdown from inside the Kiosk app, but I am currently at a standstill at what ...