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

learn more… | top users | synonyms (1)

0
votes
0answers
19 views

Tutorial: How to run a script as root when user logs in [on hold]

I needed to run a script as root when I logged in. I figured out how to do this. In terminal, become root (sudo su). Copy your script to /usr/bin: cp script.sh /usr/bin Make the script executable: ...
0
votes
1answer
30 views

shell script to function on subfolders

I want to write a simple shell script that will go into all the sub-folders in a directory, and organise the files in the sub-folders into new directories. Basically in terminal it would look like: ...
2
votes
1answer
37 views

Bash script callable from home but not scripts directory

I'm having a very weird error when trying to make a script callable. I have a scripts directory in /srv/projectname/scripts where I store you know scripts to be called as cron jobs for different ...
4
votes
3answers
69 views

How to check the number of fields given to the `read` command?

I have a quick question relating to $# in the shell scripts. So, I can use $# at the command line to check the number of a shell script arguments given by the user. Example: # ./shellScript varONE ...
1
vote
1answer
25 views

autogen.sh not found for webkit

I'm trying to install Webkit in ubuntu 12.04 following this instructions: https://help.ubuntu.com/community/WebKit When I get to this instruction: ./autogen.sh --prefix=/usr I got an error ...
1
vote
1answer
27 views

Upstart script doesn't work

I'm trying to create my own script that gets executed on startup and stopped on shutdown (referring to the classic System-V init style), but it won't work! I've created this script ...
0
votes
0answers
8 views

Start a PHP Script from Startmenu (Lubuntu)

I try to start a PHP script directly from the start menu of Lubuntu. But it doesn't work the only thing who's happening is that it starts a Terminal. I setted the permissions with chmod a+x. Hers my ...
1
vote
1answer
17 views

Disabling touchpad when desktop starts

I would like to turn my touchpad off when my desktop starts. How can I do that? I already found that the following script outputs 14: xinput list | grep -Eo 'TouchPad\s*id\=[0-9]{1,2}' | grep -Eo ...
0
votes
0answers
8 views

how to write a shell script which gets notified when an avi file is played from terminal?

For my project purpose I want to write a shell script program which runs in the background and acts as a listener to a specified avi file. When that avi file is played from terminal my script file ...
0
votes
1answer
29 views

autogen.sh script failing with autoreconf2.50: automake failed with exit status: 1

I recently heard about the Maynard desktop, a replacement for LXDE on the Raspberry Pi, and I really liked it. I was just planning on installing it on my Pi, until I found out I could compile it for ...
0
votes
2answers
51 views

How to make a python script a command?

I'm trying to make a python script into a command, eg: google's ipaddr.py (http://code.google.com/p/ipaddr-py/). I want to be able to type ipaddr and it puts out what I want. Is this possible? I've ...
0
votes
2answers
35 views

Move images from sub-folders into new sub-folders

I have a folder composed of M several sub-folders, each of them containing some text files and N images (*.png) This is what the tree looks like: /parent/ /sub-folder1/ /data1.dat /data2.dat ...
1
vote
1answer
43 views

Bash script for execute one command for many files

I just tried to clear my holiday video stuff and found program for stibilizng vision. There are a lot of files so I made script to stabilize all. Firstly I need to run command: transcode -J ...
-3
votes
1answer
38 views

Scripting downloaded programs

I downloaded a game for fun and I would like to add it as part of my code for my butler program. Say I have the game moon-buggy and I would have this code run it. if [ $word = "buggy" ] then ...
0
votes
0answers
10 views

Recompile package (with applied .diff file) after every update

I have a .diff file which I use to patch unity source code and then recompile it, so I can remove trash icon from unity panel which is important to me. However after every update of Unity, the patched ...
1
vote
0answers
22 views

Make right+left click emulate middle click on wireless mouse

Anybody have or know of a sweet little workaround script I can set to running at startup that would allow my dilapidated mouse to keep providing me with middleclick functionality even though the ...
1
vote
1answer
30 views

How do I launch my script from a launcher?

I have my custom script in Ruby with read permission, which starts with: #!/usr/bin/env ruby I can run that script from the terminal by typing that path. I added a file with .desktop extention to ...
0
votes
1answer
32 views

startup script ubuntu 12.04

Each time I startup the sistem I need to run this command sudo xhost + and the sudo service myservice restart I have decided to add a script to startup to avoid having to type it each time myself. I ...
0
votes
2answers
33 views

lscpu output differs when called indirectly?

I use lscpu | grep 'MHz' to get my clock speed. I am getting different results based on the method I am calling this command. Method 1: typing it in the terminal CPU MHz: 1200.000 Method 2: ...
1
vote
1answer
29 views

zip I/O error: Protocol error in bash script

so here's the script that i am trying to get it work: #!/bin/bash filePath="$1" fileName="$( basename "$filePath" )" backupDir="/my/backup/dir/${fileName}-backups/" dateTime=$( date ...
0
votes
2answers
61 views

How to edit a specific line of textfile in terminal with a script?

I need to change a .config text file every time the program doesn't work as I want it to. I want to be able to do it in terminal preferably with an alias and with the following logic: alias ...
0
votes
0answers
35 views

Run multiple scripts using one script on boot?

I need help. I've tried several methods to get this to work. Basically, I home host a server on my PC, the problem is, I want it to be online when logged in as every user on the computer. It uses ...
0
votes
1answer
73 views

Can someone explain the working of this bash script?

I found the following bash script which I would like to run, but I am not completely sure about what it is going to do. Can someone explain the working of the following bash script; i.e. what is it ...
0
votes
1answer
36 views

How to “show” the script, NOT run it..?

So basically, I uploaded a script to textuploader, and then used the wget command to download it to my /etc directory. Now I am able to run the script by typing: perl ...BUT, what if I want to see ...
0
votes
0answers
34 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
250 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
64 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
22 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
18 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
65 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
4answers
70 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
35 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
23 views

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

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
56 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
71 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
26 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
70 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
18 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
139 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
65 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
62 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?
-1
votes
2answers
168 views

How to grab a youtube channel

I always use youtube for getting many information I need. What i want is a script or a command line that grabs and installs all videos from a given channel path. I.e. I want to download all videos ...
6
votes
1answer
241 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
52 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$ ...
6
votes
2answers
123 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
57 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 ...
2
votes
3answers
96 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 ...
1
vote
1answer
1k 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
34 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 ...