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
1answer
24 views

Make password appear censored in bash script

I am going to make this short and simple. I am making a bash script where the user needs to enter their root password using the read command and it will be stored in a variable. What I don't like is ...
2
votes
2answers
57 views

What is wrong with this script?

So I got this script from this guide: www.tldp.org/LDP/abs/abs-guide.pdf LOG_DIR=/var/log ROOT_UID=0 LINES=50 E_XCD=86 E_NOTROOT=87 if [ "$UID" != "$ROOT_UID" ] then echo "Must be root to run this ...
0
votes
1answer
32 views

Kindly explain to me what this script does

Can someone kindly explain to me what this script does? I am a newbie to scripting language. if [ $# -eq 1 ]; then declare -x CONFIG_FILE_DIR=$1 Thanks
0
votes
1answer
19 views

Running a .bash file in Eclipse

I know this is really an Eclipse issue but I can't seem to login in their forum. I am running eclipse juno for some c/c++ development.However, I wrote a .bash script that initiate the entire ...
1
vote
1answer
16 views

passing a font as an argument to a script

I am trying to use osdSH for notifications. It has a 'font' parameter that receives a curiously formed string. From the man: -f -font Set font (Default: ...
-2
votes
0answers
20 views

Forcing letters in field only works in Chrome [on hold]

Using a BMI Calc I wrote, in order to force the user to write letters only in the name section of the Calc, I used this: function alphaOnly(event) { var key = event.keyCode; return ((key >= 95 ...
0
votes
2answers
27 views

Why the same .sh does not work with 2 different users executing it?

I have rwo users User1 and User2. I have this script1.sh inside User2 home folder: #!/bin/bash cd /home/user1 && ./script2.sh that calls script2.sh: #!/bin/bash if [ 2 > 1 ]; then ...
0
votes
1answer
62 views

Script for changing resolution!

I need help writing a script/program that changes my resolution. When I click on that program I want it to change the resolution. I'm pretty new to Ubuntu, but I gave it a try and wrote one on my own, ...
2
votes
2answers
58 views

.sh file on Startup Applications isn't executed

This is a followup to a question about dialog boxes. I want to show a dialog box both at the start of a session, and after n minutes of inactivity. I have decided to use zenity and xautolock. I have ...
1
vote
2answers
29 views

Do higher level scripting languages use shell scripts to work?

I'm just learning about bash and when I saw that bash uses 'echo' I tried to search for the relationship between PHP and bash and it seems like people are building programs were bash script and PHP ...
0
votes
2answers
17 views

Can't figure out JOIN command

I have two files and I'm trying to join them at a certain spot. I'd like to join them at the fourth column of the second file using the first column of the first. It's driving me nuts! Here is what ...
0
votes
1answer
20 views

How to schedule a shell script using crontab [duplicate]

I want to schedule a shell script to run everyday excluding sunday at 7:30 pm using crontab can you please help
1
vote
3answers
25 views

Query about a script that makes webcam take an image every x seconds

I have a Trust usb webcam. I'm looking for (or creating) a script that could take a screenshot from the camera every 10 seconds and save the image to disc with a timestamp for a filename. I've found ...
0
votes
1answer
29 views

Tell me where is mistake in anacron task?

I have tried to make this task for abacron: dm@dm-system:~$ cat /etc/anacrontab # /etc/anacrontab: configuration file for anacron # See anacron(8) and anacrontab(5) for details. SHELL=/bin/sh ...
2
votes
1answer
34 views

bash utility 'dialog' leaves a messy screen

When I run this script it displays options in a menu style on my terminal and then runs the relavent command in the script. #!/bin/sh TEMP=/tmp/answer$$ dialog --ascii-lines --title "Administrative ...
0
votes
1answer
33 views

Complicated script involving command line and XFCE Terminal

I run Ubuntu 14.04 and installed the XFCE Terminal for some reason, and what I want to do is make a script to go to a folder on my hard drive under /Server/Gen2 and run several .sh scripts in ...
2
votes
3answers
287 views

Trouble using cd command with “~” or “$HOME” in bash scripting

We know that ~ and $HOME refer to the home directory of the current user. (For me echo ~=echo $HOME=pandya). But I can't use it in bash scripting. Here is a simple example script: #!/bin/bash echo ...
1
vote
0answers
43 views

Dropbox not running after logging off: init.d vs. dropbox.py

I'm inheriting admin control over a server used to process and share data between investigators. We've been trying to use Dropbox to share some of the files. Dropbox was installed when I took over the ...
2
votes
1answer
40 views

script in bash not understood using terminal in Ubuntu 12.04 [closed]

Can anyone tells me what does this script means found in a .sh file:: [ ! -n "$T_R" ] && echo "Message Appear" && exit 1;
0
votes
1answer
21 views

variable.sh is not exporting the variable using terminal

I want to export many paths using a .sh script. after running it nothing is exported I don't know why. so if anyone can advise. This is the script used: #!/bin/bash txtrst=$(tput sgr0) # Text reset ...
1
vote
1answer
25 views

Declare a variable when running the script bash

How to declare the variable content when running the script? I know that is possible to use $1 $2 $3 to set a variable when running the script ./script.sh this is sparta, but I did not found a way to ...
0
votes
1answer
29 views

call shell script from php when ubuntu 14.04 (rightly) disables the shell for www-data

I just migrated from 12.04 to 14.04. 14.04 (sensibly) disables login / shell for www-data. But my php site needs to run some shell scripts to run stuff like kindlegen, rsyncing files to another server ...
0
votes
0answers
22 views

Permissions when running second level script

Evening Everyone, I have 1 bash script that starts the program Motion (some may be familiar with). Motion links to a script in the motion.conf upon picture save or file save to a perl script that ...
0
votes
0answers
11 views

Ubuntu crashing on purple loading screen

I've done something which unfortunately seems to have caused Ubuntu 14.04 to fail at start up and was wondering whether I could get some guidance about debugging the issue. It started when I rebooted ...
2
votes
3answers
78 views

How to activate script on laptop from smartphone?

I want to run a linux script on my laptop remotely from my smartphone (iPhone, namely). For simplicity let's say the script is called myscript.sh and it is located in /root/Desktop. I am running as ...
0
votes
1answer
35 views

Why does hitting Control + C when in an application launched from a script, break the script?

To jump straight in: while true; do #--- MENU LOGIC HERE, stick response in $MENUEXIT #----Deal with responses here if [ $S1 == $MENUEXIT ]; then tail -f /path-to-file ...
2
votes
2answers
58 views

installing a script in $PATH

I am trying to use yeoman in Ubuntu. Everything is installed correctly but I can't use the command yo from bash. If I navigate to the appropriate directory and run node cli.js everything works from ...
2
votes
2answers
194 views

How to start GUI application with upstart?

I have struggled with this problem for three days and I have tried many ways to solve it but not successful yet. I hope you guys can help me... I have an GUI application. I want to start this ...
2
votes
2answers
123 views

Translating from Red-Hat to Ubuntu

I am starting in linux because I need it for my reseach. Since I have little time and no local expert support, this is a need based self-learning experience. I have to install a tool and I got this ...
0
votes
0answers
22 views

Script runs program instead of just running script

I want to make a script to run the following command with a double click. My script is: cpufreq-selector -c 4 -g performance Manually running it in terminal is fine but if I use a .sh file it ...
1
vote
2answers
39 views

Cannot run an executable file in terminal [closed]

I have been running my script ./runenb a couple of times. I decided to log the output into a file so I used: ./runenb >output.txt and it works. Then I tried again and this time I did ./runenb > ...
1
vote
2answers
27 views

Startup script for brightness

Not so long ago I replaced XP for Lubuntu 14.04 on a old PC, and it works great. To make it perfect, I want to autoexecute "xrandr --output VGA-1 --gamma 3:3:3 --brightness 1" on startup or boot. ...
1
vote
1answer
15 views

Can a script that is run as root, run another script as normal user?

So, if I run script as root using gksu, can that script run another script as normal user? Thanks!
-1
votes
1answer
31 views

bash variable array names and getting values

As you see , i have situation to read values in different arrays, like array1 , array 2 , array3 etc. and I need to print values array1[0], array2[1], like this. I can do it individually like this ...
3
votes
1answer
38 views

How to periodically back up a folder on change?

I want to achieve the following functionality in ubuntu but I dont know how to do it. I need a daemon that periodically backs up a directory, say dir to another location by doing the following: ...
0
votes
1answer
46 views

Shell script exits without evaluating if condition

I have the following commands in my shell script #This line basically builds a source library $BUILD_CMD $CONFIGFILES/$1.prj $BUILDFILESPATH if [ $? -eq 0 ];then echo "Build success\n" #do ...
0
votes
2answers
23 views

Trouble Creating a simple script

I just wanted to create a script that opens Teamspeak. I was on here before about that, but I thought it would be more simple by just creating a script. I wanted to make a script to launch the script ...
1
vote
1answer
25 views

Writing a script to rsync all directories

I have a huge set of backup files, each containing a directory of Videos. Each video directory is slightly different. I would like to merge these into a single directory to conserve, as I don't ...
1
vote
2answers
48 views

Automating rsync commands

I currently have too many rsync commands that I run on a day to day basis. Could someone be kind enough to let me know how I can automate these commands? I am new to Linux so a little bit of ...
0
votes
0answers
28 views

Scanning a folder for new files, and then running them trough cuckoo

I want to create a folder, where I throw in all the malwares I discover. In that folder, I want to run a script that recognize a new file (the malware) and when he discovers a new file, he will submit ...
0
votes
1answer
47 views

Term Enviroment variable not set

This is the code that I want to execute through motd: #!/bin/bash IP=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'` #clear echo -e "Welcome to \e[0;32mDMS ...
-3
votes
1answer
31 views

How to put separated values together? [closed]

I would like to ask since I'm new to this environment on how I will going to make those separated values as one value together? For example: 38734 34 3542 232 Where I want 38734 and 34 to be ...
0
votes
1answer
52 views

return value from awk

This is mybashfile.sh file . . . awk -f myawkfile.awk mytracefile.tr . . . Now I want to return one parameter from myawkfile.awk to the current mybashfile.sh. Is there any way to return a value ...
29
votes
3answers
1k views

Should I save my scripts with the .sh extension?

I have some functional scripts and I want to copy to /usr/bin I want to use them as normal terminal commands. Is it a good practice to use them with the .sh extension or can I save them without ...
2
votes
2answers
178 views

Ubuntu 14.04 not running Bash scripts in /etc/cron.daily

I have a few scripts (that currently run in a CentOS system) I have moved to a new Ubuntu 14.04 system. These scripts are in the /etc/cron.daily to run once a day. These scripts are to run at the ...
0
votes
1answer
56 views

Can't install HoNClient-3.4.3.sh

I'm desktop user. My OS running 32-bit Ubuntu 14.04LTS. The problem I've run into is this: When I try to run the client in the terminal, using the command: sudo sh HoNClient-3.4.3.sh it gives me ...
0
votes
3answers
76 views

How to run a Phantomjs server with an upstart script?

I have phantomjs installed and I want to run a phantom server whenever the (Ubuntu) server starts. I am currently working locally on Ubuntu 14.04, and the server this will be deployed to is also ...
0
votes
0answers
51 views

Lost graphical login after automating script command

I'm running Ubuntu 12.04 LTS and I want to log all input/output from users. I've simply tried adding script -a -f /LOG_files/Log_file.txt to users ~/.profile. The logging works just fine, but ...
0
votes
0answers
40 views

GRUB2 /etc/grub.d/ 40_custom multi-boot

I am adding GoBoLinux to Windows Vista and Ubuntu 12.04 with GRUB2 on the MBR but I am not clear on the script or how to devise a script to replace 40_Custom. Loading the GoBo GRUB to it's own root ...
1
vote
2answers
40 views

Shell scripting, [duplicate]

I made a simple update script. Now My question was is it possible to run it automatically by loggin in on the Ubuntu Desktop and automatically provide my password (sudo) for this so I don't have to do ...