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
1answer
28 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
32 views

How to open bash files with terminal?

I am new to Ubuntu and I just started learning bash. How can I open bash files through terminal?
0
votes
2answers
37 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
17 views

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

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
30 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 ...
5
votes
2answers
123 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
13 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
17 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 ...
-1
votes
0answers
21 views

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

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
35 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
17 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
28 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
36 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 ...
0
votes
1answer
24 views

echo “${txtred}Text${txtrst}” color not always working

I have a .sh file through terminal and I'm using echo "${txtred}Text${txtrst}" as a display of what's happening when running the script. But sometimes the color is not red, although I used {txtred}. I ...
0
votes
1answer
28 views

Script Not Running Properly On Server

I am having an issue with my webserver. I am testing it out on a new kernel build and it seems as if I can't get one certain part running on it. All of my scripts work except this one. Every file ...
0
votes
1answer
28 views

How to make this start every time I start the computer? [duplicate]

I'm using a backlit keyboard and need to enter this every I start the computer. #!/bin/bash if [ -f /tmp/keyboard_light ]; then xset -led 3 && rm /tmp/keyboard_light else xset led 3 ...
0
votes
1answer
28 views

How can I create this specific executable in Ubuntu 14.04? [duplicate]

So I'd like to run World of Warcraft's .exe (wow.exe) with the following command from the terminal: __GL_THREADED_OPTIMIZATIONS=1 WINEDEBUG=-all wine wow.exe -opengl The reason for this is because ...
1
vote
1answer
44 views

script.sh run differently when manually opening terminal and when using .desktop launcher

I have a script file script1.sh as shown below: #!/usr/bin/env bash cd /home/userA/scripts . r1.sh when I manually open a terminal and run it using . script.sh it works fine. But when I created ...
1
vote
1answer
36 views

shell file opens terminal and run a sequence of commands in specific order

What I used to do is: Manually open a terminal instance to run the following commands and shell files Run PACKAGE_PATH=/home/userA/package1:/home/userA/package2:$PACKAGE_PAT‌​H run: cd ...
0
votes
0answers
24 views

CGI script seems to run but output file is not stdout but name of script file

I have the latest version of Ubuntu 14.04 installed on my laptop. I have installed the LAMP server via tasksel. I followed the instructions for Apache 2.4 from Apache's httpd.apache.org website on ...
1
vote
1answer
67 views

how to run command in an already opened terminal through a shell script

I'm running a shell script.sh which is supposed to open terminal and then run some commands in this opened terminal. What happens is that the terminal starts but the following commands are not ...
0
votes
1answer
24 views

Desktop Launcher executing a sequence of commands after opening a terminal

I've created a .desktop launcher as shown below which successfully opens terminal. What I want to do next is to run the following commands such as cd home/userA/scripts then ...
0
votes
1answer
34 views

Run some shell files from another shell file in different location

I have 5 shell files in a specific locations on my ubuntu system. I have two users on this system userA which is the main user and userB. Currently I have to manually open a terminal using user userA ...
2
votes
1answer
91 views

Stopping a running script though another script file

I am new to shell scripts. Say, I start a script like this. This runs for 3 days. So, I will start the script remotely through ssh and then close my local terminal. start.sh end=$((SECONDS+259200)) ...
-1
votes
1answer
66 views

Ubuntu 14.04 - Desktop icon is not running my BASH script

I have a simple script runme.sh which works when i run from terminal. #!/bin/bash chromium-browser "https://askubuntu.com/" But i need to make it now runnable for normal Users. So i place a desktop ...
-1
votes
0answers
28 views

How to run a script on boot? [closed]

i have the following commands i want to run when the raspberry pi boots up, it is for my bitcoin minner to start cd /home/pi/cgminer-4.5.0 sudo ./cgminer -o http://xxxxxxxxxxx -u xxxxxxxx -p ...
0
votes
1answer
69 views

Change system volume using crontab & pactl

I am trying to change Ubuntu 14.04 system volume using crontab. I am using following command: pactl set-sink-volume 1 75% Which works fine when I use it in terminal or when I run script which ...
0
votes
1answer
18 views

Ranger file manager - getting it to open archive files with custom script?

I've acquired a custom bash script which extracts all archive files and waits for input. Below: #!/bin/bash GET="." SCRIPTNAME="${0##*/}" err() { printf >&2 "$SCRIPTNAME: $*\n" ...
-1
votes
1answer
45 views

Use “watch” in executable script

Is there a way to use "watch" in an executable shell script? I mean this script should be launched with a double click, not directly from a shell... Try this script: #!/bin/bash watch gedit I'm ...
4
votes
1answer
87 views

Use custom command to open files

gedit application is set as default application for text files. Supposing I have a script with execution rights in /usr/bin, how can I set that script to be run when I open a text file using Nautilus ...
1
vote
3answers
76 views

Not able to run sed on bash script

I am working trough some legacy code which does not work, I came across a part that is causing problems. I was hoping some one could help me out and fill me in on what is the exact functionality of ...
0
votes
2answers
18 views

How do I manage session options (sound in my case) when starting program with xinit?

I have tried but failed to find proper information about xinit, in order to understand why it is that when boot into Unity and then start an application (xbmc) all is well, but when I try to use a ...
1
vote
2answers
52 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 ...
0
votes
0answers
10 views

SOHO Network Scripts

I have a trying to develop two simple scripts to automate the set up of a small office with a Ubuntu server and workstations. I am likely in way over my head, but I am trying to do it anyways. The ...
0
votes
1answer
17 views

Path to shell script in aliases with ./

I'm trying to make an alias for my shell script which is saved in ~/Dokumente/music.sh Therefore, I added following line to ~/.bash_aliases: alias music='.//home/robin/Dokumente/music.sh' After ...
2
votes
1answer
43 views

fsl.sh cannot be sourced

I need to install FSL and Freesurfer as part of running Connectome Mapper. Freesurfer required changing the shell to tcsh in order to configure its folders. Now for FSL, I have to add to .profile the ...
-1
votes
0answers
17 views

My shell script does not execute on Ubuntu, nor on Gnome server [duplicate]

I have a shell script which I made executable. When I click on it, it does not open. What do I need to do?
0
votes
1answer
114 views

init.d script doesn't log to /var/log/boot.log

The script below is working fine at system startup. However, its log messages don't show in /var/log/boot.log, when the system boots. I compared it with other init.d scripts and couldn't reach any ...
0
votes
0answers
20 views

Script to monitor Internet connection stability

guys. I'm an unexperienced Ubuntu user and I need your help. I would like to be reporteded everytime that the my router loses its internet connection. I mean, I would like to have my Ubuntu send me ...
1
vote
1answer
38 views

Shell Script Problem

I decided to make a shell script for basic nmap scanning so I did it like this : #!/bin/bash sudo apt-get install nmap printf "enter the name of site to do basic scan on >>>" read NAME ...
0
votes
1answer
42 views

Simulate power button using command?

When I hit the power button on my laptop (Ubuntu 14.04.1 without any modifications), I receive a pop window saying Goodbye, what would you like to do? Lock Suspend Restart Shutdown How can I get ...
0
votes
1answer
59 views

“Syntax error: Unterminated quoted string”

I am trying to use a backup script that will backup my sql database and website files. I am running Ubuntu 12.04 32 bit version and zPanel. Here is what my DB structure is along with which DB I want ...
0
votes
0answers
30 views

How to use folder with wildcards and spaces in find command in script

I want to use find to find files in a set of folders restricted by wildcards, but where there are spaces in the path name. From the command line, this is easy. The following examples all work. find ...
1
vote
1answer
38 views

Why won't this php script execute bash script?

Why am I not able to execute this bash script using php? I have tried exec() as well as shell_exec(). index.php <?php $old = getcwd(); echo $old; chdir($old); $message=exec("a.sh"); ...
0
votes
2answers
32 views

gnome-terminal profile without bash history

I'm trying to create a profile in gnome-terminal that doesn't store bash history. The easiest way to do that is to run export HISTIGNORE="*", but there is one problem, gome-terminal is executing ...
-2
votes
4answers
96 views

How to arrange this file properly?

I'd prefer to edit TestFile in place to get the desired output. How could I do this? This is a work box so I'd prefer to not have to install additional packages. TestFile: randomcollege-nt\jsmith90 ...
1
vote
3answers
95 views

How to kill a script running in terminal, without closing terminal (Ctrl + C doesn't work)?

I have written a bash script that calls several other programs and executes a bunch of commands. I run this script from the terminal. Now I want to kill the script. Pressing Ctrl + C sometimes ...
2
votes
1answer
42 views

how to run an --up script using network-manager-openvpn?

I'm using network-manager-openvpn (w Ubuntu 14.04) to manage VPN connections (client end). I need to run a script when a VPN is activated to fix some routing issues. I know how to do this using ...
-1
votes
0answers
11 views

vncserver prompts for password every time

I am a Linux noob, and I am performing some tasks for the very first time. I have a bash script that uses vncserver (so i would prefer to stay with vncserver). The script used to work properly when ...
1
vote
1answer
57 views

Unity - 14.04 - Set Launcher Icon Size - via command line

I've got a few computers, all coming to the end of their life. The first couple have gone and I find myself again having to re-install ubuntu on it's resurrected remains and then laboriously ...