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

learn more… | top users | synonyms (1)

2
votes
2answers
339 views

Setting cron to run a shell script: random wallpaper from a webpage

I have written a shell script which downloads random wallpaper from a web-page and sets it as a background every 5 hours. Here is the script: #!/bin/bash countervar=1; finish=0; cd ...
0
votes
1answer
37 views

Crontab script entry not working

beginner here. I have a script called updateTf2.sh It's contents #!/bin/bash /etc/init.d/srcds stop ./steamcmd/sh +login anonymous +force_install_dir ./tf2 +app_update 232250 +quit ...
1
vote
3answers
82 views

Help with a simple script

I have made a simple backup script Code: function backups_remove_file { echo "" echo "2. Make Backups Of Files(s)" echo "" echo "Which File You Wanna To Make Backups?" read back ...
1
vote
1answer
89 views

How can I create Unity dash integration for my Python script?

I have written an awesome script in Python and I seriously think it should help many rookie Ubuntu users out there -- especially for a quick solution/tip. My script searches through AskUbuntu.com and ...
2
votes
1answer
43 views

Compressing many folders

I have a directory containing plenty of folders as well as compressed files. I need to compress the folders that are not already so (tar -cvzf ...) but have no experience in sh scripts. Can anyone ...
0
votes
0answers
21 views

how to compile and upload a bash script

I found this script interesting: How can instantaneously extract text from a screen area using OCR tools? How do I compile a script, upload it to ubuntu repository and make it available with apt-get? ...
0
votes
1answer
40 views

Boot to shell script

I want to make a live usb boot just to execute a script with echo off. Then, I want it to continue to boot on to the original OS. I need to repair a bunch of computers that got attacked through the ...
1
vote
2answers
144 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
122 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
63 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
563 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
73 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
36 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
694 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
47 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
71 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
186 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
645 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
61 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
98 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
856 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
342 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
229 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
188 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
122 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
50 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
36 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
54 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
54 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
690 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
101 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
161 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
125 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
157 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
183 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
337 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
91 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
104 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
65 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
525 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
81 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
808 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
378 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
196 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 ...