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

learn more… | top users | synonyms (1)

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
26 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
vote
4answers
48 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
55 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
52 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
28 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
38 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
33 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
60 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
60 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
47 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
45 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
85 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
30 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
38 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
130 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
133 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
vote
1answer
86 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
33 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
48 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
102 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
97 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
21 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
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 ...
0
votes
0answers
12 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
20 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
59 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 ...
0
votes
1answer
229 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
43 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
41 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
48 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
126 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
46 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
47 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
48 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
97 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
155 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
80 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
vote
1answer
121 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 ...
0
votes
1answer
23 views

Paging standard out using 'more', and piping to syslog

I've implemented a wrapper script which causes all commands executed via this wrapper script to log (via rsyslog) things such as the execution time, the user that ran the command, and the exit code. ...
1
vote
1answer
110 views

Who runs scripts inside /etc/cron.hourly if anacron is enabled?

I've read that if anacron is enabled cron doesn't run the scripts inside cron.weekly/hourly/daily/hourly, as not to run them twice. So anacron takes responsability on that folders. However anacron ...
0
votes
0answers
54 views

How to run correctly bash script from another script?

I want to run sqldeveloper on Ubuntu Gnome 14.04. I created some symbolic link and tried to call from one script file another. And it fail with message: /usr/local/bin/sqldeveloper: line 2: ...
0
votes
0answers
57 views

Get file created by a program launched by a bash script

I have the next scripts: | base_dir/ | - test.sh | | tests/ | | - elaborato.sh test.sh run elaborato.sh elaborato.sh could create a file (not always it create a file). I need : to know the ...
1
vote
1answer
34 views

Desktop shortcut doesn't work for script but script work fine

#!/bin/bash/ ls -1 *.mp3 > playlist.m3u for (( ; ; )) do mplayer -playlist playlist.m3u; sleep 0.1; done This is the script and it works ! [Desktop Entry] Version=1.0 Type=Application Name=Play ...
1
vote
3answers
92 views

Permanent autostart

I would like to make a Python 3.4 script that starts with my computer so that it's permanently checked to start up with the computer (edit: permanently checked means it can't be disabled via ...
0
votes
2answers
38 views

need to match a string and then print next string matches and continue till next string

I am having troubles with manipulating a big text file, My sample f1.txt have several 3000 plus lines, with below format I need to match a string , and then match lines after that string with ...
1
vote
1answer
60 views

BASH script for extracting archives - how to make the script ask for folder destination?

I've started using the bash script below, for unpacking archives. How would I go about making the script ask if I would like to specify a folder, or just use the default folder to extract to? I'd ...