Tagged Questions

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
46 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
79 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
60 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
31 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
44 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
36 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
76 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
78 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
66 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
60 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
111 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
41 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
56 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
245 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
314 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
107 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
66 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
51 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
152 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
118 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
23 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
82 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
15 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
21 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
82 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
461 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
63 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
43 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
56 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
386 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 ...
4
votes
3answers
131 views
+100

How to pass '*' wildcard to path parameter of find command via a variable 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
58 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
56 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
101 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
344 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
129 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
246 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
25 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
348 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
1answer
71 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
66 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
43 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
110 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
39 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
67 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
375 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
72 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
181 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
94 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
39 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 ...