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

learn more… | top users | synonyms (1)

1
vote
2answers
143 views

Script that will reboot PC on specific GPU temp

Recently I've started mining litecoins. My miner consists of 3 Radeon R9 290x GPUs. From time to time one of them (not a specific one, it happens randomly) stops mining. Usually restarting cgminer ...
0
votes
1answer
109 views

Shell script while statement

I am making a script (for educational purposes) but I am kind of stuck here.. The program asks for an existing filename and checks if the filename actually exists. If it doesn't the loop repeats ...
1
vote
1answer
50 views

How do I switch desktop session users from a shell script?

I've got 2 users, foo and bar. Currently if I'm logged in as foo, I can select bar from the menu in the top-right of Unity, and since bar has no password set, I switch straight to bar. However, I ...
1
vote
1answer
60 views

Running a script from a keybinding

I've written two small scripts to change my monitor configurations. When I run these scripts from the terminal they work perfectly, however I don't seem to be able to get them to work with keybinds. ...
1
vote
2answers
507 views

Execute sh script from *.desktop file?

What I want to do at all, is that: Create script that has icon on it. So I know only one way - file.desktop file with icon. Settings icon on it was successful, but I have no luck setting EXEC value :/ ...
2
votes
1answer
72 views

How can I get a variable from terminal to use it in my script?

I'm writing small programs that are allowing me to do common commands with just two or three words max like sudo apt-get update I made it upt something like that Now I'm trying to write a script ...
0
votes
2answers
92 views

Script to search directories for .deb files and copy them for another location

If i have a directory A that contain directories B , C , D I need a script that search Directories B , C , D for .deb files and if found copy them to a location i choose . This script should ...
0
votes
1answer
35 views

Cron Script Length

I have a backup script, a script that cyncs file with other files on my computer, and a script that uploads files to my website with ncftp. I used cron to load .sh files, and my shorter scripts work, ...
0
votes
2answers
627 views

Run scripts automatically in server after ssh connection

how to run a script automatically in server soon after client system establish ssh connection with the server for ex: suppose a user will logon to my computer from another system(connected via lan) ...
1
vote
0answers
45 views

acpi-support script missing in rc.d

I've just had a look inside the directories /etc/init.d and /etc/rc.d . I have a 13.10 machine, upgraded from 13.04. Then I saw that this link was missing. S99acpi-support -> ...
0
votes
2answers
70 views

svn post- and pre- commit hooks don't work when subversion gets commited

I have no idea how to fix it. I wrote a simple bash script which writes current date and time to the file, and put it to the post-commit and pre-commit hook. When I run this locally typing eg. ...
2
votes
2answers
183 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 ...
0
votes
0answers
16 views

How to add init scripts to LiveUSB from Windows

Currently i have a LiveUSB with Ubuntu 14.04 Installed and trying to add sudo mount -o remount,rw /cdrom to init script so my read-only part of LiveUSB can be remounted as read-write partition. what ...
0
votes
2answers
590 views

How to run greeter/login script with lightdm

Is there a workaround to run a lightdm script? The one in the docs doesn't work. Anything placed there will prevent X from working. The script I would like to use is my KVM utility synergy. I ...
-1
votes
1answer
59 views

Objective: understanding File permissions

I want to write a shell script that takes two arguments: username(usr) and filename(fname), then resolve and show permissions of the given user on the given file.
3
votes
2answers
94 views

How to automatically execute a command in a terminal after a period without activity?

I've been looking for an option or script that executes a command after the terminal has been idle (that's no input nor output). The closest thing I've found is setting the TMOUT=seconds variable so ...
0
votes
0answers
52 views

Ubuntu startup and shutdown

I have an Ubuntu machine with IBM Websphere and SoapUI I use SoapUI to run a MockService and Websphere to load some web applications and services. I want my machine to shutdown at 23:59 and to power ...
0
votes
1answer
766 views

Double-click on .sh file to open terminal and execute series of commands in it?

I'm trying to double click on a file that does this: #!/bin/bash #Mount USB Jump, Copy files to it, Unmount it. [open terminal (so that I can see what 's going on)] pmount /dev/sdc JUMP sleep 2s cp ...
0
votes
1answer
305 views

Write script to open browser at specific URL on login?

I've been using Ubuntu for a few weeks, and I want to know more about automating tasks. How can I write a bash script to open a web browser with a specific URL after startup?
0
votes
2answers
225 views

how do I use upstart, instead of cron, to start a single instance of a job which should always respawn?

How do I script the following bitcoin/dogecoin/etc cpuminer command: /home/digger/cpuminer/minerd -o stratum+tcp://doge.pool.webxass.de:3333 -O <user>.<worker>:<worker_password> ...
0
votes
2answers
184 views

cron error: bad username

I've basically re-written the terminal output instead of appending a series of edits to this question: root@doge:/etc/cron.d# root@doge:/etc/cron.d# tail /var/log/syslog Dec 21 11:35:01 doge ...
1
vote
2answers
117 views

Checking if vim is installed successfully in Ubuntu 12.04

I am a newbie in linux,maybe it's a silly question but could not make it though. I have ubuntu 12.04 installed without GNOME and now as i wanted to know more about linux am facing few queries. I ...
1
vote
1answer
48 views

Files access/modified in a process/script

I will be getting some shell scripts that I, kind of, dont know what they will be doing. But I need to know what I/O operations the script performs (e.g. files they read/access,files they write, ...
0
votes
1answer
35 views

Copy Files from folder to folder on base of md5sum

I have a problem regarding to copying files, Problem : I have a list of md5sum, and a folder having 1000+ files, How can I move files from folder to another folder with the help of md5sum list. I ...
0
votes
1answer
53 views

I need help adding a script to /etc/rc.local

This seems simple but I can't seem to figure it out. I am trying to write a script to mount a drive on startup. the command I want to run is: google-drive-ocamlfuse ~/gdrive But i want it to run ...
1
vote
1answer
52 views

Running a script at shutdown

I've read the answers to this and similar questions already, but so far none had worked for me. On my Ubuntu 11.10 (oneiric) system, all the files in /etc/rc0.d/ and /etc/rc0.d/ are links. I put ...
0
votes
2answers
671 views

How to add the logs to a crontab with time stamp

In crontab, I scheduled a daily backup script. Now when the cron executes the script the status are logged to a log file as shown below. 0 0 * * * /home/backup.sh > ...
0
votes
2answers
97 views

Configuring Lubuntu to run a script when LXDE starts

I'm using Lubuntu and LXDE. How can I configure it such that when LXDE starts, it runs the following script to turn off the trackpad: xinput disable 14 I tried to make the files ...
2
votes
2answers
158 views

Least bad way to shutdown quickly

Sometimes I would like to shut down in a hurry. By hurry I mean 5 to 10 seconds. Assume I can run any script with root privileges in tty which I've prepared beforehand, and after 5 or 10 seconds the ...
0
votes
1answer
120 views

sending email if disk space exceeds

I have a script to calculate available disk space and alert by email if the limit exceeds a given value defined by me. Here is the script: df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 ...
0
votes
0answers
155 views

How to delete multiple files?

I need to select and delete multiple files from ubuntu one, which are synced every time I uninstall and reinstall Ubuntu One on my Android device. If I delete them from the folder on my computer ...
0
votes
0answers
180 views

Running a script with cron

When a script is run manually, it works with no errors. The script is to add a user. However when run in cron, I get emails saying: sudo: no tty present and no askpass program specified Sorry, try ...
1
vote
1answer
331 views

How to run bash script in upstart conf file?

I made bash script "kvm_manage". How should I write .conf script and run my bash script inside? It is possible? I am beginner..
0
votes
1answer
90 views

Concatenation in Shell Scripting Bash

I wanna check if 2 lines have equal $4 my shell must check if the diffrence between $3 in line 2 and $2 in line 3 is equal 1 it must concatenate both line into one like this 1;1000000000;1099999999;2 ...
0
votes
2answers
42 views

when to use -f or -a tag in if loop

I'm confused between two tages that can be used in if statement in bash scripting. One is -f and other is -a. Their description states as follows: [ -f FILE ] True if FILE exists and is a regular ...
1
vote
3answers
102 views

How can I prepend a random letter/number to the beginning of each filename?

I'm working on a system where I'd like the first letter of each filename to be random - not necessarily unique, just random. I'd like to be able to run this from a cron job. For example, I would be ...
0
votes
0answers
58 views

Disable and enable USB

I am trying to make a little script where I can turn on and off a USB port so a little USB light connected to the port will turn off when the port is disabled and on when it's enabled. And as I said, ...
-4
votes
5answers
474 views

Can not run script file [closed]

i am new at ubuntu i tried run a file an post_setup.sh from the teriminal by typing: gksu gedit post_setup.sh making it executable does nothing as well, and the apps is called COMODO ...
3
votes
1answer
73 views

How to check if the AC laptop adapter is plugged or not?

I need to check in a bash script running when my laptop starts if the AC adapter is plugged or not. Is this possible?
1
vote
1answer
773 views

/etc/acpi/powerbtn.sh for full shutdown menu?

I'm having the same problem as 13.10: Power button shuts down directly and Ubuntu 13.10 with Cinnamon Desktop Environment This answer seems to be the way to go, but I don't know what the command is. ...
1
vote
1answer
350 views

How do I get the filename from inotifywait events?

So I'm doing a simple inotifywait loop to watch for changes in a Bootstrap directory: while inotifywait -r -q --format %w bootstrap/; do echo "something happened" [[ $filename == *.js ]] ...
0
votes
0answers
55 views

How to auto-run a script each time a Global Keyboard Shortcut is used in Ubuntu?

I don't want to reassign the Global Keyboard Shortcut keys. They should be doing their what they were meant to do. But in addition to that, I would like a bash script to run every time the particular ...
1
vote
1answer
193 views

Is Zenity progress bar affecting variables

Hi guys I am currently trying to implement zenity progress bar to my while loop, however I noticed that my variable which are meant to be incremented did not increment. Here is a sample test script I ...
0
votes
0answers
20 views

kutil in a script

kutil need input multiple line parameters in order to generate a keytab file look at here. Can I make it just one line of command or can I put it into a script? And how?
0
votes
2answers
209 views

Cannot move file to subdirectory of itself

I'm having a little problem with renaming a bunch of files in a folder. The script: for file in $1 do mv $file $file | sed -r 's/^.{20}//' | sed 's/.\{16\}$//' done The output: mv: cannot ...
0
votes
0answers
18 views

Starting Arachnophilia from shell script

I am using Arachnophilia which under older versions of Ubuntu, I was able to start using a shell script. After updating to 13.04 the shell script won't work. I opened up a terminal then cut and ...
1
vote
0answers
57 views

Lubuntu: script starting during lxsession for every users

i'm trying this, but in Lubuntu 13.10, the same script 1) in /home/user/.config/lxsession/Lubuntu/autostart works 2) in /etc/xdg/lxsession/Lubuntu/autostart does not works How can (and where) i can ...
-1
votes
1answer
69 views

How to run a script on Login [duplicate]

I want to get a script started on each login from domain users... how to do it? /etc/init.d/ is on startup not on login afaik.
0
votes
1answer
33 views

What is the order of execution of the scripts at /etc/rc0…6.d/?

The scripts linked at /etc/rc0...6.d/ have numbers at the begining right after the letter S/K, so the question is what is order of execution? From the lower to higher or higher to lower? I also would ...
1
vote
1answer
198 views

I'm parsing the output of `ls` and something went wrong

I made this simple script to copy a file recursively to many sub-directories. Here I am showing the problem for 3 sub-directories. I have 3 sub-directories and 2 files in a directory as follows ...