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
2answers
18 views

Add custom script to PATH

I know there are quite some answers about that, but still could not make my way around it. I read all this and tried to follow the example under System-wide environment variables (for my case of ...
1
vote
1answer
32 views

In 14.04 how do I run a bash script I wrote without opening a terminal?

I use terminal a lot. I wrote a script and have it in ~/blah/script.sh now. How can I run the script from Unity (Dash?)? A long time ago I would have used ALT-F2 and typed my command, but that ...
0
votes
0answers
37 views

What is an argument? [on hold]

I need to add a new argument containing this "The new arguement will be a path for a folder you want backed up. Your script will replace each instance of /var with that arguement. You should be able ...
2
votes
3answers
237 views

Batch rename — multiple image types

I have a large number of images that I copied from a failing external hard drive. All of the images are fine and have no corruption, but oddly a large number of them are now missing extensions. The ...
0
votes
0answers
18 views

Where is the laptop brightness script located?

Online I found the command: echo 1 > /sys/class/backlight/acpi_video0/brightness to set my screen brightness to the lowest possible value, currently I am grepping my entire disk for that path, ...
0
votes
1answer
17 views

Weechat error: unkown command “script” (type /help for help)

While trying to set an autoloading python script in ubuntu, I received the error listed in the title. A google search returned no similar issues and when I type /help scriptthe output returns: No ...
1
vote
2answers
51 views

gibberish command not found on bash terminal startup

I have run across an issue that I just cannot seem to figure out. When I start my terminal in ubuntu (14.04) I get the message sdfsdfsdi: command not found As you can see it just looks like ...
2
votes
0answers
27 views

Port redirection for a specific (dynamic) IP using iptables script

What I want: Incoming TCP and UDP connections on port 900 from the resolving IP address of myip.dyndns.org (dynamic IP) should redirect to port 5050 on the local machine. All other IP addresses ...
1
vote
2answers
192 views

Script doesn't work when it is run using '#!/bin/sh'

I have a script that use shebang : #!/bin/sh, but when I run it in my Ubuntu 14.04 terminal, it doesn't work and it says that some lines has unexpected operator. My friend in another computer could ...
1
vote
2answers
55 views

How to run commands from a bash file the way they run from terminal?

Sorry for my probably very naive question. What I mean is: how to create an executable script/bash file that would run more complex commands, commands which must normally be put in a terminal? ...
0
votes
1answer
19 views

Where does the output of a script that was run at startup go? [duplicate]

I have a script which is run at startup from rc.local, I don't redirect the output anywhere. When I first wrote it, I ran it in a shell, it worked as I expected and continually poured characters out ...
0
votes
1answer
32 views

unable to execute .sh scripts - only on one pc

This is an unusual problem for me - what would cause one pc to suddenly be unable to execute an install.sh script, yet two other pcs with the same OS have no problem doing so? I get various errors ...
0
votes
1answer
29 views

Starting a script in a Desktop icon

I have the following .desktop file on my Desktop: [Desktop Entry] Encoding=UTF-8 Name=Robomongo Comment=Launch Robomongo Exec=/usr/local/robomongo-0.8.4-i386/bin/robomongo.sh ...
1
vote
1answer
36 views

Commands not executing in shell script run by udev

I'm having trouble using udev to run a shell script that backs up my hard drives to an external drive whenever the external drive is connected via USB. Everything works except the actual call to ...
1
vote
2answers
65 views

“mv” versus “cp” in a bash script [closed]

I am attempting to make a script that will be able to load up some settings and files to a board. Basically I will plus a flash drive into the board click on the script. The script will then ...
0
votes
1answer
24 views

Ubuntu bash if lessthan else condition returning error [: -lt: argument expected

I am doing the following script to know if profit or loss from entered selling price and cost price as; echo enter selling price read sprice echo enter costprice read cprice if [ $sprice -lt $cp ] ...
0
votes
1answer
36 views

Script needed to copy data to a mounted storage device

I have a 1 TB HDD. And have problems copying data to it whenever i update it on my Ubuntu Machine.Can anybody suggest me how to make a script for Ubuntu such that whenever i mount it copy the newly ...
1
vote
3answers
67 views

Sort videos by bitrate

I have a folder with some 300 videos. I want to sort these by their video bitrate. I use a command 'mediainfo' to obtain the bitrate info of a file . Is it possible to write a script (possibly in ...
0
votes
1answer
22 views

git push script, only if difference

I've found some nice questions illustrating how one would write a script automating git push/pull with cron here and here, but I want to elaborate on that slightly. I only want to push/pull if there ...
2
votes
1answer
46 views

Trouble with simple script :(

Could someone please tell me why this script doesn't run correctly. Seems to be a problem with the if statement as i keep getting the error: /home/sinttx/Development/backup/ddbackup.sh: line 18: ...
2
votes
2answers
169 views

Cron Job Creation

Okay, so I have had a quick look at the answers posted on this question and re-formulated my cron job. So, let me break this down as clear as I am able to: PC/OS | Shell Info I am currently running ...
1
vote
1answer
32 views

How to create your own commands that can be used anywhere [duplicate]

I am new to linux, and I am learning bash scripting at the moment. I was wondering how I would save my script as a command and then be able to call that command anywhere in the terminal. So i could ...
1
vote
1answer
24 views

why my bash script only outputs one line on echoing awk variable

Anyone can probably tell I'm new at scripting and have tried doing as much homewaork before posting here. I have what I think is a simple script parsing out DNS zone file for IP and unique domain ...
0
votes
0answers
8 views

writing a pre-uninstall script for my ppa

I have implemented my personal ppa for a python script, the program is working well. Now, I would like to write a pre-uninstall script to replace the .bak files, but I don't know how to place it in ...
1
vote
1answer
20 views

One time “firmware” upgrade script

I was wondering how you could make a script so that on first boot it changes files to a specific parameters? So it would be like if I just installed a fresh kernel. I want to run a script once and ...
3
votes
3answers
80 views

How do I create a single-execution Upstart job guaranteed to complete before two other jobs begin?

How does one write an Upstart task that is guaranteed to run only once after each startup but is also guaranteed to run to completion before either one of at least two other jobs start running. I do ...
0
votes
2answers
46 views

After performing apt-get dist-upgrade Perl scripts will no longer ignore invalid SSL certificates on 14.04

Good morning all, Last week I decided to run the commands to upgrade packages on my 14.04 Server to ensure that I was patched for the recently found Bash vulnerabilties. Per the info here ...
2
votes
2answers
35 views

How to install the Jason plugin for jEdit?

I am a newbie in Ubuntu (14.04) so I am very appreciative if you can guide me how to install Jason as a plugin of jEdit. Jason installation homepage. jEdit plugin installation instructions. The ...
0
votes
1answer
35 views

Need Help Improving Script

I have a group of folders (L1N-L5N), in which I want to copy from my /home/michael/documents/XXX to my Dropbox folder. At present, I have used the following script: #!/bin/sh cp -ra ...
0
votes
0answers
34 views

rtorrent multiple commands after download finish

I cannot get two commands to work after a download is finished in rtorrent. First I want the completed files to move to another folder which works fine, but then I cannot get it to fire the second ...
0
votes
1answer
49 views

Cron job daily not running

I'm having trouble with setting a cron job to run daily when I enter the script to /etc/cron.daily when I put it there it doesn't run at all like it should be doing. I setup a script so that it can ...
1
vote
2answers
80 views

Loop through all folders and executing script

I have a bash script install.sh in my current directory and I have a directory apps which contains multiple directories. I want to loop through these sub directories in app folder and execute some ...
1
vote
0answers
46 views

I sudo'd a bash script, full of sudo apt-get install applicationname commands, and now my programs won't run

I sudo'd a bash script, full of sudo apt-get install applicationname commands, and now my programs won't run, unless they are ran as sudo (BAD IDEA!) How do I fix this issue?
2
votes
2answers
43 views

Ubuntu equivalent of CentOS success / failure

A lot of services in CentOS look like this (except green and red, respectively): $ sudo service blah start Starting blah: [ OK ] $ sudo service notrunning stop Stopping notrunning: ...
0
votes
1answer
30 views

xinput - no effect at startup

I have a script that uses xinput to slow down the mouse which works perfectly when run on the command line. So I create and run it from ./config/autostart/fixmouse.desktop, It runs at X startup with ...
0
votes
2answers
35 views

Problem with bash script [duplicate]

I have a little problem with a script of mine. I execute a command in background using sudo and I try to retrieve the PID of the command in a variable. the code is the following: #!/bin/bash sudo ...
0
votes
1answer
19 views

Unexpected interruption in Ubuntu starup file

I got a problem with the upstart files of Ubuntu in /etc/init/. I am trying to run a process if it does not already exist. So I wrote a conf file and start with "start" The following two files are ...
0
votes
1answer
45 views

SH file not executing successfully

I am new in linux. Trying to run sh file which connects the server over FTP or VSFTPD and get some files. Here is my Script #!/bin/sh HOST='IP_ADDR' USER = 'user' PASS = 'password' FILE = ...
0
votes
4answers
75 views

How to open bash files with terminal? [duplicate]

I am new to Ubuntu and I just started learning bash. How can I open bash files through terminal?
0
votes
2answers
64 views

Rename files in subfolders with parent folder names

I have a main directory that has four folders f1, f2, f3 and f4 each of these folders has 10 folders, and each of these 10 folders ff1...ff10 has some .jpeg images with some names lets say image1.... ...
0
votes
1answer
27 views

My bash script depends on ffmpeg which was removed when I upgraded to 14.04. What to do? [duplicate]

I have a bash script to capture images using the webcam and it depended on ffmpeg. I recently upgraded from 13.10 to 14.04 and noticed that ffmpeg was removed and this script wouldn't work anymore. ...
1
vote
0answers
37 views

Script for hiding files

I recently found a script for hiding desktop files and folders. The following is the script: #!/bin/bash # cd /home/ramvignesh/Desktop for f in `ls`; do mv "$f" ".$f" done The script isn't working ...
6
votes
2answers
184 views

How can I delete numbered files in a given range?

I have folderA that has some files with a number sequence starting with a_000000. What I want to do is to delete files starting from a specific number: let's say a_000750 till the end of files in this ...
-1
votes
0answers
15 views

After security upgrade on 12.04 I lost several setup.sh files in root directory

Toady, after applying an ubuntu upgrade and restarting my computer, when i first open the terminal, bash began to tell me that a setup.sh did not exist. I thought this to be strange. When I went to ...
0
votes
1answer
25 views

Run scripts in a folder from “Run Application” launcher in ubuntu

I have some bash scripts in my ~/bin folder. I have added this folder to my PATH variable in ~/.bashrc, so I can run them from terminal easily. But I want to run them by simply typing them in the "Run ...
-2
votes
0answers
27 views

what does the return “Cc:” mean after exectuting a bash script? [closed]

I have written a bash pipeline for NGS analysis which worked well. I then tried to make it work for multiple input filenames with the following at the beginning of the script: for i in filename1 ...
1
vote
4answers
47 views

using sed replace the new line with character

I am using sed command to remove the new line and replace with <br> but I am not able to get the desire output. I wrote : find . -name $1 -print0 | xargs -0 sed -i '' -e 's|\n|ABC|g' but ...
0
votes
0answers
33 views

Bash Script for adding Keyboard Layout to available Layouts

I am writing a bash script to add a layout (Urdu as input language) to the available keyboard layouts. The current status is: script automatically detects the current layout, as a string. adds te ...
1
vote
3answers
51 views

How to get list of all non-removable disk device names (SSD/HDD and SATA/IDE only)?

I need a list of all disk device names (not USB or CD ROM) in the following form DRIVES='sda sdb' so that I can loop through them in a bash script. Ideal solution would not have to install a special ...
1
vote
1answer
49 views

How To: Keep running script only when the network (internet connection) is idle?

I have a script (actually, a Rails application with a Sidekiq job queue system), which uploads pictures and albums to Flickr. This data is huge for my purposes (around 100GB), and the upload is slow ...