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
27 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
216 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
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 ...
0
votes
0answers
16 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, ...
1
vote
2answers
46 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 ...
15
votes
4answers
9k views

Script to display all terminal colors

Throughout the internet I have seen many people with scripts that prints out a bunch of stuff in all the colors defined in ~/.Xdefaults. However when I try to use these, I always get error: Bad ...
2
votes
0answers
24 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
5k views

Why can't I write to a file even after 777 permission?

On my ubuntu server I have Apache and PHP and all that nessory stuffs.. but when I run a php file <?php ...
1
vote
2answers
54 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? ...
16
votes
7answers
7k views

How can a script check if it's being run as root?

I'm writing a simple bash script, but I need it to check whether it's being run as root or not. I know there's probably a very simple way to do that, but I have no idea how. Just to be clear: What's ...
1
vote
2answers
190 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 ...
0
votes
1answer
18 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 ...
6
votes
1answer
716 views

Why is $0 set to -bash?

First login process name seems to be set to -bash, but if I subshell then it becomes bash. for example: root@nowere:~# echo $0 -bash root@nowere:~# bash root@nowere:~# echo $0 bash -bash is ...
0
votes
2answers
2k views

sudo bash can't execute script

I try to run a shell script file but failed so far on Ubuntu. In my terminal: ~/Desktop/FTL/data$ ls amd64 exe_icon.bmp FTL licenses resources x86 ~/Desktop/FTL/data$ sudo bash ./FTL.sh [sudo] ...
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 ...
16
votes
7answers
12k views

Command to convert an upper-case string to lower-case?

What is the Bash command I can use to convert an upper-case string to lower-case and vice-versa? Thank you.
1
vote
1answer
32 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
61 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
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 ...
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
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
35 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 ...
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
1answer
21 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: ...
3
votes
3answers
77 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 ...
2
votes
2answers
166 views

Cron Job Creation

Solved Okay my answer was resolved with the help from the people in the comments (first cron job, so excuse the plethora of mistakes I made). I had removed all the comments in my cron table and ...
0
votes
2answers
64 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
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 ...
0
votes
2answers
1k views

terminal closes when i run shell script

I wrote my own shell script, and I made it executable with "chmod +x" command. But when I click to shell file and want to run it in terminal, it suddenly opens and then closes in a second. What is the ...
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 ...
2
votes
1answer
6k views

Tomcat Installation startup.sh not working

So I've followed the list of steps on : https://www.digitalocean.com/community/articles/how-to-install-apache-tomcat-on-ubuntu-12-04. When I try to run the startup script, I get this message: ...
0
votes
2answers
43 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
33 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 ...
7
votes
6answers
2k views

How can I run this sh script without typing the full path?

I'm still very new to Ubuntu. I'm using 12.04, and I'd like to know if there is a way to run this program/shell script without typing: /opt/idea/bin/idea.sh It's kinda tedious and I'm quite lazy. ...
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
68 views

Reset History inside a bash script [duplicate]

I want to make a bash script that clears the history i.e. works similarly as the command history -c So I started with the following code:- #!/bin/bash history #displaying history history -c ...
1
vote
2answers
75 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
44 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
42 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
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 ...
7
votes
3answers
3k views

Upstart, one job definition to start and one to stop

Hi i just discoverd ubuntu upstart (etc/init/* scripts). And i would like to use it to run a particular application. This app is run via a command line, but there is an argument to start an instance ...
0
votes
1answer
44 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?
53
votes
1answer
5k views

Can I make the webcam take a picture when an incorrect password is entered?

I am using a laptop . I was thinking to have a support in my Ubuntu machine. When an incorrect password is entered, a picture is taken later revealing who has been trying to gain access. I have ...