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

learn more… | top users | synonyms (1)

3
votes
2answers
635 views

How to shutdown Ubuntu after (2 hours) of idle?

Running: Xubuntu 14.04 32bit. I have read several outdated, not working, working different that I want answers here and elsewhere. I had a script that resulted in shutting my Laptop down at boot time ...
4
votes
2answers
647 views

regex search works with `grep -E` but not with bash script?

I use the same regex with grep and it gives me a match but when doing it in a bash script, it return no match. Test String(part of the file testregex.txt): <a ...
1
vote
3answers
174 views

Run Bash Script in Client from Local Server?

I wrote a bash script for my use and it works. I want that script to be put in some server in my network and call that script in laptops / desktops in my network itself to execute. Any way I have made ...
0
votes
1answer
28 views

Rename new files as the old ones

I have a large music collection, and a good number of playlists that I have formed over the years. All the music is neatly organised in a folder hierarchy. I have managed to get my hands on higher ...
0
votes
1answer
47 views

export list of duplicate images on digikam/findimagedupes/fsplint/geeqie

I have 60000 images. And when I ask any of the following tools to come up with similar photos, all of them pop out a big list of around 3000 names of images. digikam gives a cool UI which lets me see ...
1
vote
1answer
70 views

Need script for ubuntu

Need a script to use in ubuntu I've bunch of .tgz folders in folder A, each tgz is having some files and tar files, inside the tar files there are folders and sub folders. Wants to move a particular ...
0
votes
5answers
336 views

crontab not running as root

Mysql backup scripts not running as root crontab - help I'm trying to run a crontab as root but the script is not running successfully. I can see in syslog that the script is executing but it does ...
1
vote
1answer
52 views

Command line to check version of a file with wget?

http://paste.ubuntu.com/7159470/ Is there a way to check the version of a file using wget, and then download it if it's newer? Trying to make an update script/launcher for a game. wget ...
-1
votes
1answer
39 views

Rename default “Ubuntu one” folder on 12.04 server possible? [duplicate]

I'm running Ubuntu 12.04 server from home and using Ubuntu One as backup site. I'm not great at scripts (beginner) so when writing bash scripts that I later crontab for backups, having to use "Ubuntu\ ...
0
votes
1answer
80 views

How to clear history from a script? [duplicate]

I am writing an script to dump my history log into another file "myhistory.log", and then clear that history. I have written the following set of commands: date >> myhistory.log history ...
1
vote
1answer
80 views

How can I alphabetize a multi line record from a text file?

Hi I'm working with bash script and I have example.txt below. How can I alphabetize the following 4 information about restaurants by the restaurant name and print it out? Note that the format when ...
0
votes
0answers
18 views

Automatic shut down and reboot at specific time [duplicate]

I have an assignment that requires me to write a script that shuts down a server at 11pm and reboots it at 6am daily. So far, I have only written a command to shut it down but I do not know how to ...
2
votes
2answers
51 views

How can I write a script to install BleachBit only if the version installed is not a certain version?

I want to write a bash script to download and install BleachBit from a .deb file only if the version already installed is not 1.0. I am using Ubuntu 12.04 and Bleachbit is only version 0.9 in the ...
1
vote
2answers
118 views

Selecting multiple files with in bash

I want to use Scriptreplay with multiple log/timing files located in the same Directory. The script I have right now looks like this: select timings in /mnt/home/$USER/shell_logs/*; do clear ...
1
vote
1answer
24 views

Use a Radiolist with Scriptreplay

I want to crate a programm using dialog that gives me a radiolist of logfiles (working) and automatically replays them using scriptreplay but I can't get it to work because the filepath that gets ...
4
votes
1answer
764 views

How to batch rename files (images) based on CSV file

What I have and want to achieve: There are thousands of images in one folder. I have a CSV file with following columns: A: original name B: renamed name A typical row looks like this: ...
0
votes
1answer
134 views

Using for loop to create a flexible radio list in a dialog box from a shell script

I want to create a little Program using Dialog to play logfiles created with Script. The problem is that I can't get a dynamic radio list that automatically adds a row if a new logfile is created. So ...
1
vote
1answer
79 views

Is there a command to scan my network and check the conflict IPs

It's hard job to find the duplicate IP when this happens. You know you have then to search all network IPs to check the duplicate. So is there a command line or a script to do that for me?
6
votes
1answer
302 views

How to run a script when password is entered at the lock screen?

To toggle the enabling/disabling of my notebook's touchpad according to connected USB mouse, I used touchpad-indicator, which runs a daemon to monitor connected devices and take appropriate action. ...
0
votes
2answers
327 views

How to remove redirection unexpected syntax errors

I am loading using Ubuntu for beagleboard-xm sd card partition so after last stage of partition I have entered a command like this ./omap3-mkcard.sh /dev/sdX I have got ti-lab@KILBY:~/angstrom-wrk$ ...
7
votes
2answers
194 views

How to run a script when there is a change in your local IP?

Before marking as a duplicate: this is not about dynamic DNS or similar things. I know how to run a script every time my networks goes up; it is a simple matter of adding a script in the directory ...
3
votes
2answers
228 views

How can I check for apt-get errors in a bash script?

I am writing a bash script to install software and update Ubuntu 12.04. I would like the script to be able to check for apt-get errors especially during apt-get update so that I can include corrective ...
3
votes
3answers
1k views

Create a .desktop file that opens and execute a command in a terminal

I would like to know how to write the Exec command of a .desktop file to open a new terminal and execute a shell script in it. The shell script is working and accessible by all users. When launching ...
2
votes
1answer
4k views

How to uninstall Popcorn-Time installed with a script?

I've installed Popcorn Time using the following command: cd wget https://raw.github.com/hotice/webupd8/master/popcorn-build chmod +x popcorn-build ./popcorn-build that I found here. How can I ...
4
votes
1answer
104 views

Can't login after adding script to /etc/profile.d

I have created a little script to add bookmarks in Nautilus to redirect users to network share. If I run the script manually, it works brillantly but as soon as I try to add it in /etc/profile.d, I ...
3
votes
1answer
259 views

pkill not killing

I have a Script named PirateRadio.py That I am writing a script for. I need to kill and reload the script. Possibly with the same PID. I thought SIGHUP was a sure thing. when i run #pkill -1 ...
1
vote
1answer
47 views

Could I make Automatic Backup Folder For All new files I create or download?

I want to make a folder for all the new files I create , some times I create them at different places (e.g Desktop , Download , Document etc ) The Question Why would I do that ? and The Answer Is ...
5
votes
3answers
421 views

Evaluating a string in shell script

I am following this bash shell scripting guide: http://www.tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html In the section Numeric Comparisons, it cites an example: anny > num=`wc -l ...
1
vote
1answer
58 views

Live CD: Script doens't work correctly after login

I have a PXE/NFS Server (192.168.1.10), a client PC and a diskless PC. I installed base ubuntu to client PC. I wrote this script (update.sh) to work after login to client PC. SERVER=192.168.1.10 echo ...
2
votes
1answer
95 views

Prevent www-data from running scripts and programs

I discovered this little PHP script that allows you to enter GET requests manually from the browser address bar and execute commands. I played around with it and discovered that I could do all kinds ...
0
votes
2answers
45 views

Script to install Ubuntu and same set of programs on several computers

I have several computers at different locations, and I want all of them to be set up in exactly the same way. Is it possible to write a script which I can run once I have installed a new Ubuntu OS to ...
1
vote
1answer
1k views

NDK_ROOT enviroment variable defined but script does not see it

In my ~/.bashrc i have this: export ANDROID_SDK=~/Devel/android_dev_x64/sdk export ANDROID_NDK=~/Devel/android-ndk-r9d export NDK_ROOT=$ANDROID_NDK export ...
1
vote
2answers
151 views

Echo command with color option in script and command works differently

If I run echo -e "\e[1;31mThis is red text\e[0m" in comand line, It prints out red text. However, if I use write it in script file test.sh #! /bin/bash echo -e "\e[1;31mThis is red text\e[0m" run ...
1
vote
1answer
49 views

shell script + mutt: mutt terminating while loop

I am having a problem with mutt exiting my while loop prematurely in my shell script. The while read MAILTO loop of my function sendFiles will only process (send) the first file and then returns. ...
2
votes
1answer
153 views

Run .bash_profile script at login

i'm working on a deb package that allows the administrator to create another account and run that account automatically in kiosk mode. I created the user, specified a shortkey and put that in a hidden ...
1
vote
1answer
282 views

Call shell script “inline” in another shell script

So the bottom line here is that I am trying to have one go-to script work to set environment variables (let's call it setenv.sh) that will be used in subsequent scripts. In Windows (I know, that is a ...
1
vote
1answer
2k views

Run bash script from php

I want to run a shell script within a php webpage to check some processes running on my system (Ubuntu 12.04). Googleing I've found about shell_exec() but I can't manage to run the script when loading ...
1
vote
1answer
203 views

Script not running in crontab, file not found

I need your help to run a bash script in crontab. As many other posts in askubuntu I'm facing the problem that a script that is properly running in terminal mode does not run in crontab. The error I ...
3
votes
1answer
80 views

How can “git gui” open repository from parent directory?

I start Git GUI tool using command git gui or git citool. I wanted to add another entry to right click script menu (already have dozens of commands) and created a script like this: #!/bin/sh git ...
0
votes
2answers
49 views

Can not find file

Am new in Ubuntu, I have install kde plasma desktop, and want to install kde base plug in, and I have to run a configure.sh script file, and I try to type in: ...
3
votes
2answers
111 views

How to unistall a program installed by a .sh installer?

I downloaded a .sh program (in this case is a game) and then I installed using "sh name.sh" (or maybe it was "bash name.sh". I don't remember quite well, but I guess it has no importance in this case ...
1
vote
1answer
98 views

How can I control the KDE monitor configuration from a script?

Every morning I come to work, plug in my sleeping laptop into the large monitor on my desk, and then fiddle with this dialog: I imagine that the result of this fiddling is that the "Display ...
3
votes
3answers
296 views

Rename files incrementally in a specific directory?

I have a directory containing bunch of .txt files , I need a command to rename these files by one command , so their name will be : file1.txt , file2.txt, file3.txt , etc . Any Help ?
8
votes
2answers
178 views

Get the total listening time from the CLI with banshee

Is there a way I can get total listening time from command line? I want to write a script to keep track of how much time I spend listening to music on a daily basis.
2
votes
1answer
72 views

Is it ok to just add a script to rc6.d?

I just made a script to backup my files at shutdown and added it to init.d then linked it to rc6.d and I gave it the prefix or runlevel of "K01myscript". The question is, will it cause any problem ...
3
votes
2answers
155 views

How to make sed works with break lines from file?

I'm adapting this script to insert file's content into another file. This is what I have now: #!/bin/sh # Check if first and second parameters exist if [ ! -z "$2" ]; then STRING=$(cat $1) # ...
0
votes
1answer
1k views

Cannot run cron job for a php script

I want to run a php script using cron job on localhost my script is situated at - /opt/lampp/htdocs/rrugd/myscript.php now as opt is under root, i tried adding the cron job for root as well as ...
28
votes
7answers
5k views

Repeat a command every x interval of time in terminal?

How can I repeat a command every interval of time , so that it will allow me to run commands for checking or monitoring directories ? There is no need for a script, i need just a simple command ...
0
votes
4answers
71 views

Basic bash printing question

I know this question is basic knowing how to write script, but I didn't learn that yet: I have a program that takes, as an input, a list like: str_1,str_2, etc. The string is always the same, but the ...
1
vote
1answer
114 views

How can run a gsettings command inside a postinst script from a custom .deb package?

I want to change the wallpaper when a custom .deb package is installed. In the postinst script I've written this: PID=$(pgrep gnome-session) export DBUS_SESSION_BUS_ADDRESS=$(grep -z ...