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

learn more… | top users | synonyms (1)

3
votes
1answer
54 views

pkill not killing

I have a Script named PirateRadio.py That I am writing a script for. I need to kill and reload the script. Possibly with the same PID. I thought SIGHUP was a sure thing. when i run #pkill -1 ...
1
vote
1answer
35 views

Could I make Automatic Backup Folder For All new files I create or download?

I want to make a folder for all the new files I create , some times I create them at different places (e.g Desktop , Download , Document etc ) The Question Why would I do that ? and The Answer Is ...
5
votes
3answers
191 views

Evaluating a string in shell script

I am following this bash shell scripting guide: http://www.tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html In the section Numeric Comparisons, it cites an example: anny > num=`wc -l ...
1
vote
1answer
31 views

Live CD: Script doens't work correctly after login

I have a PXE/NFS Server (192.168.1.10), a client PC and a diskless PC. I installed base ubuntu to client PC. I wrote this script (update.sh) to work after login to client PC. SERVER=192.168.1.10 echo ...
2
votes
1answer
49 views

Prevent www-data from running scripts and programs

I discovered this little PHP script that allows you to enter GET requests manually from the browser address bar and execute commands. I played around with it and discovered that I could do all kinds ...
0
votes
2answers
34 views

Script to install Ubuntu and same set of programs on several computers

I have several computers at different locations, and I want all of them to be set up in exactly the same way. Is it possible to write a script which I can run once I have installed a new Ubuntu OS to ...
1
vote
1answer
238 views

NDK_ROOT enviroment variable defined but script does not see it

In my ~/.bashrc i have this: export ANDROID_SDK=~/Devel/android_dev_x64/sdk export ANDROID_NDK=~/Devel/android-ndk-r9d export NDK_ROOT=$ANDROID_NDK export ...
1
vote
2answers
45 views

Echo command with color option in script and command works differently

If I run echo -e "\e[1;31mThis is red text\e[0m" in comand line, It prints out red text. However, if I use write it in script file test.sh #! /bin/bash echo -e "\e[1;31mThis is red text\e[0m" run ...
0
votes
0answers
26 views

shell script + mutt: mutt terminating while loop

I am having a problem with mutt exiting my while loop prematurely in my shell script. The while read MAILTO loop of my function sendFiles will only process (send) the first file and then returns. ...
2
votes
1answer
63 views

Run .bash_profile script at login

i'm working on a deb package that allows the administrator to create another account and run that account automatically in kiosk mode. I created the user, specified a shortkey and put that in a hidden ...
1
vote
1answer
62 views

Call shell script “inline” in another shell script

So the bottom line here is that I am trying to have one go-to script work to set environment variables (let's call it setenv.sh) that will be used in subsequent scripts. In Windows (I know, that is a ...
1
vote
1answer
232 views

Run bash script from php

I want to run a shell script within a php webpage to check some processes running on my system (Ubuntu 12.04). Googleing I've found about shell_exec() but I can't manage to run the script when loading ...
1
vote
1answer
53 views

Script not running in crontab, file not found

I need your help to run a bash script in crontab. As many other posts in askubuntu I'm facing the problem that a script that is properly running in terminal mode does not run in crontab. The error I ...
3
votes
1answer
38 views

How can “git gui” open repository from parent directory?

I start Git GUI tool using command git gui or git citool. I wanted to add another entry to right click script menu (already have dozens of commands) and created a script like this: #!/bin/sh git ...
0
votes
2answers
42 views

Can not find file

Am new in Ubuntu, I have install kde plasma desktop, and want to install kde base plug in, and I have to run a configure.sh script file, and I try to type in: ...
3
votes
2answers
72 views

How to unistall a program installed by a .sh installer?

I downloaded a .sh program (in this case is a game) and then I installed using "sh name.sh" (or maybe it was "bash name.sh". I don't remember quite well, but I guess it has no importance in this case ...
1
vote
1answer
53 views

How can I control the KDE monitor configuration from a script?

Every morning I come to work, plug in my sleeping laptop into the large monitor on my desk, and then fiddle with this dialog: I imagine that the result of this fiddling is that the "Display ...
3
votes
3answers
210 views

Rename files incrementally in a specific directory?

I have a directory containing bunch of .txt files , I need a command to rename these files by one command , so their name will be : file1.txt , file2.txt, file3.txt , etc . Any Help ?
2
votes
1answer
33 views

Is it ok to just add a script to rc6.d?

I just made a script to backup my files at shutdown and added it to init.d then linked it to rc6.d and I gave it the prefix or runlevel of "K01myscript". The question is, will it cause any problem ...
3
votes
2answers
132 views

How to make sed works with break lines from file?

I'm adapting this script to insert file's content into another file. This is what I have now: #!/bin/sh # Check if first and second parameters exist if [ ! -z "$2" ]; then STRING=$(cat $1) # ...
0
votes
1answer
178 views

Cannot run cron job for a php script

I want to run a php script using cron job on localhost my script is situated at - /opt/lampp/htdocs/rrugd/myscript.php now as opt is under root, i tried adding the cron job for root as well as ...
0
votes
4answers
64 views

Basic bash printing question

I know this question is basic knowing how to write script, but I didn't learn that yet: I have a program that takes, as an input, a list like: str_1,str_2, etc. The string is always the same, but the ...
1
vote
1answer
65 views

How can run a gsettings command inside a postinst script from a custom .deb package?

I want to change the wallpaper when a custom .deb package is installed. In the postinst script I've written this: PID=$(pgrep gnome-session) export DBUS_SESSION_BUS_ADDRESS=$(grep -z ...
4
votes
2answers
192 views

How do I iterate the arguments in a bash script?

Is there any method to iterate the passed arguments in a bash script? This answer from my question shows me how to use each argument, but I want to iterate them because the number of arguments is ...
3
votes
1answer
159 views

How to check in a bash script if passed argument is file or directory?

I have to write a simple bash script in Ubuntu which would allow me to pass it some arguments and I want to check if these arguments which can contain spaces are files or directories. How can I do ...
0
votes
2answers
27 views

How can I change this script in order to delete directories as well?

find /folder/*.* -mtime +14 -exec rm {} \; I tried rm -r and with -R argument, but without any result.
1
vote
1answer
46 views

How can I get a file's UbuntuOne URL from the terminal?

How can I get the UbuntuOne URL from a file in a bash script? Here's what my script does so far: I run the script via Nautilus Actions, and it requires one parameter and an URL in the clipboard. The ...
1
vote
1answer
45 views

How to see if there are any qbittorent torrents from shell script?

I run a script on startup that opens a browser, irc, and qbittorrent. It looks similar to this: chromium-browser & qbittorrent & xchat & guake & Is there any way I can detect if ...
1
vote
2answers
80 views

how to write a script that will execute xampp start and stop

I am trying to write a script that will enable xampp start and xampp stop with the same script without having to write in the terminal everytime. To start xampp, I write in console : sudo ...
0
votes
3answers
363 views

Autocomplete terminal commands [duplicate]

I had done this previously but now I don't remember the trick, Something like when you type in command in terminal it should auto complete it by matching it with the similar commands given in History, ...
1
vote
2answers
116 views

Create a Screen session with a bash script using contab

I want a .jar file to run every time the server boots up (we're using a VPS), and so I've edited crontab using crontab -e and then adding @reboot bash /home/bash/startserver.sh. But I haven't even ...
4
votes
4answers
222 views

How do I extract the version number portion from the version string?

How do I extract the version number from string=customer-asset-tag-1.0.2.9? Desired result: Component= customer-asset-tag version number=1.0.2.9
0
votes
1answer
24 views

script to backup file deleting file

Working on a bash script to take backup of a file, but the problem i get is that mv delete the file or rename it and create a file with the backupname. Script: test="/home/sysadmin/test/hei2.back" ...
1
vote
1answer
53 views

How to check if a restart of open-iscsi was ok

I am working on a bash script to connect a iscsi initiator to a target. After I have edited the iscsid.conf in the initiator I have to restart the open-iscsi with the command: service open-iscsi ...
1
vote
0answers
43 views

Can I open a new terminal with a new binary executing in it?

I tried to write a script that opens a new xterminal with some binary file(not command) running in it.The whole script looks like this: #!/bin/bash XTERM="/usr/bin/xterm -bg WHITE -e ...
2
votes
3answers
300 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. ...
2
votes
1answer
41 views

How to deleting files depending on their usage?

How can I use a script in order to delete files according to how much I using them? There are a large amount of files under a directory. I would like to preserve such files which I use (open) very ...
0
votes
1answer
40 views

Crontab wont run a script

I've set a script to run every 10 minutes using cron, but it does not run. It works when I run it manually. bin path is /usr/bin/. The script contains: #!/bin/bash scrot 'screenshot.png' -e 'mv $f ...
0
votes
0answers
13 views

Startup script for pxeboot

I am working on pxeboot. Now i want to do startup script in pxeboot server and whenever client started the startup script will run on the client machine. How to do that. ?
1
vote
1answer
39 views

Check if connection worked if not return error

Working on a bash script to connect a iscsi client to a server. How do I put this command: iscsiadm -m discovery -t st -p 10.0.0.30 in a if to check if the connection was established, if not it ...
3
votes
1answer
53 views

Why doesn't the xbacklight command work in rc.local?

When I execute the command xbacklight -set 10 in my terminal the brightness is set to 0.1 as it should. But when I use this command in my rc.local-file, then it is not executed upon start -- because ...
0
votes
2answers
45 views

Start-up / Reboot scripts for different users

I'm still trying to learn a little more about bash scripting and start-up / reboot, I have read about crontab @reboot and also just looking at other options but I just wondered if someone could maybe ...
0
votes
1answer
59 views

.bachrc $PATH doesn't find my python scripts

I've tried adding a path to my .bashrc file as follows export PATH=/beda/users/home/user252083/bin:$PATH and yes, I can then run the binary "bader", which is in the bin folder from anywhere. I also ...
0
votes
0answers
35 views

Java -jar arguments being ignored

I'm using Ubuntu 13.10 and Oracle Java 1.6.0_45 (need the oracle version for some development work I'm doing). I can recreate this problem with nearly any jar file but the specific one is with a ...
3
votes
2answers
132 views

How to create a native application from a Shell Script?

I created a little application using Bash and Zenity that I wish to install on my system as a native application as well as a package that I can distribute. I have a .desktop file for my application, ...
1
vote
1answer
77 views

Script to rename files

I appreciate any help in advance. I have written a script to rename all .BMP files, and it seems to work, but I get the following error/message for each file: IM2019.BMP mv: cannot stat ...
5
votes
1answer
102 views

Oneliner command to use kill given tcp port number instead of PID?

I often do e.g. sudo netstat -lpn |grep :8088 view the output tcp6 0 0 :::8088 :::* LISTEN 11189/java and then sudo kill -kill 11189 I'd ...
0
votes
0answers
22 views

Hibernation fails, after trying to repair no-WLAN-problem

After noticing that my Ubuntu 13.04 had no WLAN function after resuming from hibernation, I tried the sudo restart network-manager as explained in this question: No wlan after standby . It brought ...
0
votes
0answers
107 views

Preseeding/Kickstart Ubuntu install

I am trying to achieve the following: I have created a kickstart script as adviced here: Automatic Installation - help.ubuntu.com and want to run it from the live session, without passing a boot ...
1
vote
1answer
165 views

How to run vbscript on ubuntu 12.0.4?

I ve just installed ubuntu 12.04.4 on my laptop. I want to use vbscript for cding on my website, because we have the vbscript for our study course [ class 11 multimedia cbse]. but I cannot find a ...