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

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
37 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
58 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
42 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
84 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
127 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
128 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
85 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
32 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
100 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
94 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
19 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
55 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
220 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
47 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
115 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
43 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
46 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
47 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
148 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
76 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
114 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
22 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
102 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
56 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
33 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
58 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 ...
1
vote
2answers
208 views

How do I run a script on Unity login/logout?

I have two scripts - one to mount some folders over SSHFS - and one to unmount. I would like to launch the mount script when my default Ubuntu desktop is launched (after I log in at the graphical ...
1
vote
2answers
54 views

Automatic screen capture script

I'm looking to accomlish exactly what Anwar Shah describes here Bash script to take screenshot and save the image - Ubuntu with the added functionality of setting a time increment for the script to ...
0
votes
2answers
123 views

setting up a script to rotate scren Lenovo Yoga Thinkpad S1

I am trying to set up a Lenovo Yoga Thinkpad S1 to rotate the screen with the touch of a button but I am having a little trouble with the script that actually does the work. I have found the scripts ...
0
votes
2answers
63 views

Open terminal in 'always on top' mode on startup

I want Ubuntu to open a terminal in the lower right corner when I log in, with the always on top mode enabled. I have made a script which does this when I run it from a terminal, but it does not work ...
0
votes
1answer
29 views

Simple bash script not working

I'm pretty new to bash scripting. I'm trying to make a script to export the http_proxy variables. This is what I do from the terminal: $export http_proxy=http://proxy21.iitd.ernet.in:3128/ $export ...
-1
votes
1answer
89 views

run bash script from another script and redirect its output

Hi everyone I have to do a program.. I'll be really concise to explain it... And hat I've already done and what i have to do... Simply, I have to do a "simulator" in Bash that run exercises of ...
0
votes
2answers
35 views

End script and restart it with the same options and arguments

Usually !! repeats the last given command. But it doesn’t seem to work in a bash script. Is there a way to end a script and repeat it with the exact same options and arguments given the last time? ...
0
votes
1answer
34 views

problem occuring while creating .exe file

I'm trying to run test problem in the mfix but got struck with an error sh: 0: Can't open ../../model/make_mfix. bhaskar@admin2-Precision-T7600:~/mfix/run/tests/Added_Mass$ sh ../../model/make_mfix ...