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)

1
vote
1answer
13 views

Trying to access debian/scripts and debian/rules

I am trying to rebuild the kernel because I want to change jiffies to 1ms. I'm following a turorial and it is stated that I shall do chmod a+x debian/scripts/* but I can not find the debian folder ...
1
vote
1answer
119 views

Run multiple line as a single line command bash

Is there any way to run multiple line as a single line command in bash script. This is my multiple line bash script id=15; if [ $id -ge 30 ] then echo Successful echo $id else echo fail echo $id fi ...
2
votes
3answers
156 views

Creating a folder based on a portion of a file name

I have several files named such: KILN_SDUS51_N0SILN_201203020003 KILN_SDUS51_N0QILN_201203020003 KILN_SDUS51_N0RILN_201203020003 I need to file all of them into folders based on the three ...
1
vote
1answer
44 views

script sh syntax error

I have this script: #!/bin/bash IP='192.168.1.1' fping -c1 -t300 $IP 2>/dev/null 1>/dev/null if [ "$?" = 0 ] then echo "Host found" else echo "Host not found" fi When I try to run it, ...
1
vote
1answer
29 views

cannot change directory with script [duplicate]

I tried the following script to give myself convenience in changing directories to different hard disk partitions. But after its execution, the default location does not change, but if I use command ...
1
vote
1answer
27 views

Why is my script file executable on a virtual machine?

I have ubuntu installed on a virtual machine in Windows. There when I run a script I just type sudo ./blabla.sh in the terminal to run it. Then I installed ubuntu from same iso file directly on a ...
1
vote
1answer
7 views

How to disable touchpad while running full screen applications?

Laptop support in Ubuntu is rather disappointing. It's like Ubuntu and Kubuntu are two different worlds. Is there a script to disable touchpad while running full screen applications? I tried to write ...
0
votes
0answers
9 views

Help writing an Upstart script

On my Ubuntu 14.04.2 server there's an installation of ownCloud with its News app. Now, for some reason or another, a couple of days ago the app stopped pulling new articles via owncloud cron.php. ...
0
votes
0answers
22 views

Xinput command in autorun script doesn't execute

I use two monitors 15 inch and 19 inch. With the 15 inch I also use a touchscreen. I have to map touch events to 15 inch monitor with this command: xinput map-to-output 11 VGA1 11 stands for id ...
1
vote
2answers
73 views

Shell script does not run when I double click

I have made a shell script (test.sh) on my Lubuntu (15.04) desktop. Permissions are: Only owner (View content + Change content + Execute). When I double click test.sh, I choose "Execute in Terminal". ...
1
vote
2answers
41 views

error while cron scheduling a sh script

This is my shell script which i want to schedule using cron job. parser.sh #!/bin/bash source .profile workon venv cd /home/ashish/deployments/myproject export ...
1
vote
4answers
51 views

Output a list of all file names in a directory with the last 5 characters removed from each

I have a directory that contains files with names, 00004.time, 00010.time, ... There is not pattern except the format, <5 decimal digits>.time I would like to output to a file, just the ...
-2
votes
1answer
18 views

Zenity is not displaying the GUI results in the bash script. The same script is displaying results successfully in Redhat [closed]

ALERT=10 df -h|grep -i dev|grep -vE '^Filesystem|proc|none|tmpfs|udev' |awk '{print $1 " " $5 " " $6}' |while read output do partition=$(echo $output | awk '{print $1}') usage=$(echo $output | ...
0
votes
0answers
29 views

How to run a compiled cpp file after booting up the system [duplicate]

I am using an arm v7 soc system which runs ubuntu very well. I can run my compiled cpp file (compiled with g++) perfectly from terminal by ./myproject. However i want code to start automatically ...
1
vote
2answers
22 views

Need my random effects to show the full line

I am working on a script for random predictions and unfortunately instead of the script taking the full lines from the two random lists (Things and Effects) it prints a random word from each. Can ...
0
votes
1answer
14 views

Bash sed to read auth into debconf-set-selections for Vagrant VM

I have a Vagrantfile that uses a bash script to set up a VM. I can't get the script to set a password for MySQL using debconf-set-selections with output from an .auth file. Below is an example of the ...
1
vote
0answers
22 views

Why do I need to restart Ubuntu 14.04 LTS for my networking scripts to work?

When I started using 13.04 LTS on my Virtualbox VM (4.3.26), I turned off network manager and wrote some scripts for dynamically updating the static IP of my laptop on any network. I was doing this ...
0
votes
0answers
35 views

How can I get shebang lines to work in Ubuntu Touch?

If I create a Bash script with a shebang line like #!/bin/bash, make it executable (chmod 755 setup.sh) and then try to run it directly (./setup.sh), I am presented with the following message: bash ...
2
votes
0answers
36 views

What's a good way of protecting password on a plain text executable script?

I am managing a few dedicated game servers on a Ubuntu server 14.04 machine. These games are downloaded and updated by the SteamCMD tool, which for some games, requires login from the command line ...
0
votes
2answers
39 views

Renaming files with a prefix and suffix in folders of varying depths

I have many images of varying extensions (jpeg,jpg,png) contained in many different directories, many of which my be contained in other folders for organizing. Such as: Folder 1/ Folder A/ ...
0
votes
0answers
25 views

Need to automate kill wpa_supplicant on resume on 15.04 with systemd

I need to run sudo killall wpa_supplicant automatically after resume. Unfortunately on 15.04 with systemd it isn't possible with scripts. How this may be automated?
3
votes
2answers
24 views

How to start app or script after system update

I would like to start my script after or during every Ubuntu update. For example: If I make command sudo apt-get upgrade, I want to start my script after successful update. Same if I make update ...
1
vote
2answers
35 views

Help with reminder script in Bash

I have stacked trying to make a simple reminder script which can compare the running date with the date that a file has. for example I have a file that contains: Apr 25 2015 cycling \n Apr 26 2015 ...
2
votes
1answer
158 views

How to automatically answer interactive cli program (not script) with bash script?

I've googled this, and almost all I could find is to answer a bash script and this doesn't work for me. The answers I found told to do: echo "yes" | ./script or ./script <<< yes or ...
1
vote
1answer
26 views

Script that prevents the software to run unless other associate software is already running

I have a situation here. We wanted to prevent a software to run successfully unless the other software is already running. If the script has been run, it run the main software and it will check if the ...
2
votes
4answers
304 views

Bash script to rename files in a directory

I am trying to write a script that takes a directory as a command line parameter and iterates over the files in the directory changing their extension to .bu . I thought this would work but I'm ...
1
vote
1answer
38 views

Running Shell Script on Double Click

Okay, I have opened nautilus and edited preferences to ask when I double click an .sh script to run in Terminal. Well, I don't want to use a .desktop file; I want to just simply double click on the ...
1
vote
3answers
52 views

Commands or script to clean out media folder of unwanted filetypes

I have a media download folder with all sorts of irrelevant files e.g. readme, txt and torrent files in addition to the mp4, avi, mp3 and other valid media files. I want a script or a set of ...
0
votes
0answers
19 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
6answers
333 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 ...
3
votes
2answers
83 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(Hour-sound) that i made: #!/bin/bash mplayer ...
7
votes
3answers
116 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 watched and whenever a file is added to that directory, ...
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
14 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
95 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
47 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
23 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
2answers
76 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
19 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
15 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
163 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
48 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
30 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
222 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
22 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
15 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
32 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
38 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
139 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? ...