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
3answers
161 views

logout current user from script

I would like to create a script that: run some commands execute sudo su - [some other username] after I exit from [some other username] -> logout Example: test.sh echo "test script" sudo su ...
0
votes
1answer
51 views

How to pass a command with variables to at?

So, I'm making a bash script that's supposed to accept times and an extension from the user (through zenity) and schedule a call with sipcmd at the given time: extension=$(zenity --entry ...
3
votes
3answers
114 views

bash: populating array with elements containing spaces and special characters

I want to be able to populate elements of an an array with arbitrary strings, i.e. strings that may contain \ and spaces for instance. I wrote this : #!/bin/bash function populate_array () { if ...
0
votes
1answer
36 views

Run the script with screen

I write a script to run p2pool. I can not understand how to add a run through the "screen -dmS"? #! /bin/sh ### BEGIN INIT INFO # Provides: p2pool start # Required-Start: ...
0
votes
1answer
37 views

set -n not working in shell script when executing with source

this is the shell script.. #!/bin/bash set -n <<COMMENT1 tHIS IS A MULTILINE COMMENT MAN COMMENT1 <<COMMENT1 THII COMMENT1 : echo "this is ashok" echo "${LOGNAME}" when executing ...
0
votes
0answers
32 views

Script in /etc/network/if-up.d not executing when eth1 is on

I have a script in /etc/network/if-up.d . My intention is that script will execute automatically whenever my eth1 interface is up. But it is not happening. The script also have 755 permission level. ...
0
votes
0answers
93 views

I want to run a script on boot system Ubuntu 14.04 Server

I've done anything like this I made a symlink in /etc/init.d sudo ln -s /home/sts/erp-enterprise/bin/jleaf-apps /etc/init.d then I run the command $ sudo update-rc.d jleaf-apps enable then ...
-1
votes
2answers
66 views

I want to run a script to start the server automatically at system Ubuntu 14.04 Server

I've done anything like this I made a symlink in /etc/init.d: sudo ln -s /home/sts/erp-enterprise/bin/jleaf-apps /etc/init,d then I run the command: sudo update-rc.d jleaf-apps enable then appears: ...
2
votes
3answers
63 views

How to make a bash script execute when the battery on my laptop begins charging/discharging?

I have a conky setup that displays my battery level. The problem is, whenever I plug/unplug my laptop from the charger I need to run the conky-startup script to get it to display properly. I find this ...
0
votes
0answers
18 views

Xchat and cronjob?

I've submitted a thread in Ubuntu forums. Where I talked about if there's a way to automatically send a message after a certain amount of time. One guy replied and said to me that he has wrote an ...
1
vote
3answers
102 views

Bash: What to do when control-c won't kill a process, is there a better solution to the on/off button?

The full title of this question is: Bash: What to do when control-c won't kill a process, due to the fact that the bash script contains a loop which calls another process: Is there a better solution ...
0
votes
0answers
46 views

Shell script to retrieve MTR data

I made a script, to retrieve the data of a mtr to a specific IP, and log into graphite the average time response (ms) and the packet loss: But sometimes, the script fails, mtr report come like this: ...
1
vote
1answer
381 views

passing file from bash script to gnuplot script

I am new to gnuplot and I am troubled in passing my argument alot, now I have this simple bash script and a gnuplot script. in the bash script plot.sh I should modify my file then send it to the ...
4
votes
5answers
387 views

Count the sum of each column in a file

In a file with different number of columns delimited by space ' ', How to count the sum of the columns. An example would show the need: File A: 1 2 2 3 4 5 6 1 1 1 5 Then the output would be: ...
-1
votes
2answers
40 views

How to copy an executing script from current folder to another by double click

How should we copy an executing script from one folder to the another? The script content is: #!/bin/sh zenity --forms --title="Add Friend" \ --text="Enter information about your friend." \ ...
0
votes
1answer
60 views

Help Creating Rsync/Crontab script that checks if ExtHD is mounted before running

I have a toshiba 3tb ExtHD and it consistently gets unmounted if I say shutdown computer then turn it on to a live cd then reboot back into OS. Its a simple fix, all I do is unplug and re-plug the USB ...
-1
votes
2answers
54 views

Strange behaviors in adding integers from Python script [closed]

This python script is adding the sums of the numbers entered in a single line delimited by space except that it is not adding correctly. Thanks in advance. Print "Enter Numbers:" ...
3
votes
1answer
292 views

How to check if two or more programs are installed using a bash script?

I want to check whether two or more programs are installed using a bash script: hash foo &> /dev/null if [ $? -eq 1 ]; then echo >&2 "foo not found." else echo "foo found" fi ...
0
votes
0answers
59 views

Execute jar file when user mount a loop block device linux

I successfully created and mounted a loop block device using these commands. dd if=/dev/zero of=my_fs bs=1024 count=30720 losetup /dev/loop0 my_fs mount -t ext3 /dev/loop0 /mnt/fs_mount_location/ ...
0
votes
2answers
262 views

Environment Variable seems to be set yet not working

I use Ubuntu 14.10 with bash shell. I downloaded a gradle distribution and moved it to a new directory. I want to permanently set a environment variable to point to the bin sub-directory of the ...
0
votes
0answers
54 views

Failing desktop notification from script

I am running an APC UPS for my home VOIP equipment. My Ubuntu 14.04 LTS computer with apsupsd is also plugged into this UPS, and I have modified apcupsd's onbattery script to shutdown the computer 1 ...
0
votes
2answers
40 views

How to backup and reinsert .bashrc-like files with post-install script?

I have my proudly written .bashrc and .bash-aliases files. Sometimes, I edit them. More often, I reinstall the whole system. What is the best and simplest way to preserve content of files (for ...
0
votes
1answer
37 views

Bash script to log all recent apt-get installs and locations

Sorry if something like this already exists, but in my research I found no evidence that it did. what I want: a "monitor" type script that I can write, that I would "activate" prior to apt-get ...
0
votes
1answer
120 views

Hiding terminal when executing zenity bash script by double click

Is there a way to hide terminal when a bash script for zenity is executed eg: szAnswer=$(zenity --entry --text "where are you?" --entry-text "at home"); echo $szAnswer I want to hide the terminal ...
1
vote
3answers
54 views

Rename directory using a variable

I have a directory that contains thousands of sub-directories. Structure like this: Dirs: 1 2 30 109 I want to rename all the directories by adding 10000 to their current name. E.g. Dirs: ...
2
votes
1answer
44 views

rsync multiple IP's using bash script?

I am trying to use rsync to synchronise remote files with local server. It works great but I want to do it on multiple remote servers to sync with on daily basis. sshpass -p "xyz" rsync -avz ...
3
votes
3answers
132 views

Bash program to open files on a second monitor

I've written a little script in bash that opens a file and then five minutes later closes it. It repeats this procedure on and on. The problem is that whereever the mouse is pointed the program ...
2
votes
1answer
41 views

How do you copy something to the clipboard when running a script triggered by incron?

I've got a script that works perfectly when I run it as myself on the command line but when the script is run by incron the line that copies a value to the clipboard doesn't work. Basically I'm using ...
0
votes
0answers
30 views

cron script issue when sending mail to multiple recipients

I have a script to generate reports every morning and mail it out to multiple teams. Since I want to make the script generic (there are many reports) I added the following in each script- ### Mailing ...
0
votes
1answer
30 views

Issues Installing a Tool Set

I am working on a research project that requires me to utilize data from NASA's Fermi Large Area Telescope. NASA provides users with a package of tools to manipulate and utilize the data they'd be ...
7
votes
3answers
417 views

Display the current date & time in the window's title

Is it currently/technically possible to display the current date & time (ie: digital clock numbers) to the currently active window? Like appending some text from a script?
3
votes
2answers
138 views

Is there a way to autostart CPULIMIT in order to reduce excessive CPU consumption

tracker-miner-f, tracker-store, tracker-extract and dropbox processes are killing my CPU, they make it run at over 100%, overheating my laptop. I have installed CPULIMIT and it works great ...
1
vote
0answers
30 views

Permission change after moving file? [duplicate]

I want to run a bash script in a directory /media/aliakbar/New Volume(internal drive)/further/path/to/file . The problem is: with chmod +x the file's permission is not changed (proof: I couldn't ...
1
vote
1answer
405 views

I keep getting bad substitution error on bash scripts with arrays

I've been working on a Bash script using an array. I keep getting this message, "Bad substitution". So I Googled the problem and every example I came up with supposedly works but not on my computer. ...
0
votes
3answers
46 views

I need to change Gamma to .8 on startup

I added the command sudo xgamma -gamma .8 to rc.local in order to change the gamma on startup but its not changing it: #!/bin/sh -e # # rc.local # # This script is executed at the end of each ...
0
votes
1answer
27 views

Expand mouse-wheel volume control to whole panel

There is one application I missed back from Windows and it is Volumouse. Simple yet effective app which enables you to control volume from the whole taskbar (panel) not just from indicator icon. ...
-1
votes
2answers
64 views

BASH text editing [closed]

Currently working on a project where I need to edit the text on a bunch of nearly identical spots. Basically, I need to turn this 30 SCF Done Ti 52.3941 48.0198 49.5622 Ti 49.4797 49.061 ...
0
votes
1answer
92 views

Why did my nemo scripts disappeared?

If you are using the Nemo file manager from the "WebUpD8" PPA (https://launchpad.net/~webupd8team/+archive/ubuntu/nemo) you might have noticed that you cannot launch your custom scripts any more. The ...
2
votes
1answer
140 views

Find and Rename recursively in folders, subfolders and multiple files

I'm new with shellscript and I'm having some problems trying to do what I need... I want to 'optimize' all my *.png images and found this so I made the bash as it says with: #!/bin/bash pngnq ...
1
vote
3answers
113 views

Bash shell for loop process with two paired variable names

It's common to use bash shell for example to bulk rename plenty files. Usually I used the following structure, for file in ./*.short do # do command done That's for filename with .short extension. ...
3
votes
1answer
105 views

Execute Script when Android Phone is connected to specified/selected USB Port

I´m having some trouble with my udev rule. At the moment, I had my udev rule setup to execute a script whenever a Android phone is connected to any USB port on the computer. But I don´t want the ...
1
vote
0answers
20 views

How to configure ccsm from the command line or a script?

THE GENERAL PROBLEM: I wish to change some settings of ccsm from the command line, or more precisely a script. I imagine there will be some arcane combination of gsettings or gconftool that does what ...
3
votes
2answers
65 views

Script Remove All hardlinks for a specific file

I want to delete all hardlinks for a specific file. The usage would be script somefile, this would count the hardlinks for the file somefile, then it's going to delete all hardlinks keeping this ...
1
vote
0answers
11 views

How to track the Internet connectivity of two PCs simultaneously using a script?

I have two PCs and I want to monitor the Internet connectivity in both of them and make it available in a page (not local, and something like example.com/statuses) as to whether they're currently ...
0
votes
1answer
33 views

Chromium app closes after executing the bash script by double click

I have a chromium app which i want to execute from a bash script. I am successfully able to execute this command from terminal and able to open the app but when i tried to double click the script the ...
0
votes
0answers
49 views

live555ProxyServer as daemon service

I would like to make live555ProxyServer as a daemon service which would start each time my pc reboots. How do I properly implement start and stop in init.d script file? This is what I have right now ...
3
votes
1answer
54 views

How to search for files through hashsums

I search for files often in my files system by either using the tree command and grep, or the find command, but recently I downloaded some content from a site, but forgot where I saved it, now I know ...
5
votes
1answer
178 views

Run script when monitor is connected

I am trying to run a script located in usr/local/bin/ when I connect an external monitor to my laptop. I have tried to add a new udev rule but that did not work. I created a new file in ...
5
votes
1answer
96 views

Use the bang-commands (e.g. '!!') of bash in scripts and aliases?

Is it possible to use the so-called bang-commands (! + command/symbol, like e.g. !! or !$:p) in bash scripts and in bash aliases? I wanted to add the line alias getit='sudo apt-get install !!' to ...
1
vote
0answers
108 views

Script with xdotool not working properly on a fresh reboot

I want to run streamus (chrome app) to stream youtube from terminal and asked a question relating to that in this same SE. I also got a wonderful answer and a script for my problem. But that script ...