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
1answer
48 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
85 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
356 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
150 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
23 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
66 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
40 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
49 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
54 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
64 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
24 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
46 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
79 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
34 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
73 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
32 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
64 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 ...
28
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 ...
3
votes
3answers
2k 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
130 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
246 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
60 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
157 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
49 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 ...
-1
votes
1answer
96 views

Shell scripting add slashes in file name with space

I am a newbee and want to write a shell script in which I will look up in a certain directory for zip file and unzip it to certain directory. File name can have spaces like this "Harry's 20 july.zip" ...
0
votes
1answer
28 views

Script for changing access rights of multiple files and directories?

I want to create a script that changes the access rights for all files and folders in a specific directory tree. All users should have read and write access for all files and directories. Does anyone ...
0
votes
1answer
37 views

don't have permission or doesn't exist

I'm trying to configure an Oculus rift and I have a configuration script that needs to be executed: GLADOS@deathbox:~/Desktop/OculusSDK/Tools/OculusConfigUtil$ ./OculusConfigUtil_i386 bash: ...
0
votes
0answers
15 views

Script to automate launch of various terminals and various commands [duplicate]

I am trying to use a script to automate various proccesses when I launch the script. I use this to restart postgresql and metasploit services then launch armitage echo -e "\033[32mRestarting ...
2
votes
2answers
314 views

Opening multiple terminal tabs and running command

I need to open multiple terminal tabs, give them titles, go to a directory, and make each tab run a command. I am new to Linux and shell scripting, after searching online and checking some solutions, ...
0
votes
2answers
75 views

Running a .sh from a .desktop [Making an icon for Minecraft.]

Rather recently, I've decided to add minecraft to my dock. I play it enough to want it on my dock. I created a .desktop file, and I gave it an icon, name, and such. I figured that point the exec at ...
1
vote
2answers
209 views

How to run perl script in background

I am new user to ubuntu... Putting & and in the end is putting the application on background, but not really, it still gives me the output of the perl script in my command line even though it is ...
3
votes
3answers
285 views

Setting a randomly generated password to a variable?

I'm using the following line to create a randomly generated password in a bash script, but it doesn't look like the string is actually being set to the variable. #Generate random password ...
0
votes
2answers
87 views

Bash script to enable / disable SSH

Im running ubuntu 14.04 LTS (no GUI) and im looking to write a bash script that does the following: Check to see if the ssh service is enabled or disabled If enabled, then disable, if ...
1
vote
1answer
70 views

How to Start Program After SSHD is Up and Running

I'm working on a project that requires I start a GUI before the login prompt. I had this working under 12.10, but today I migrated to 14.04 and it's breaking stuff. At this point I've configured Grub ...
0
votes
0answers
9 views

Create startup script for openproject [duplicate]

I consider myself a linux noob, but I was able to install openproject on a Ubuntu 12.04 server in VirtualBox. Currently I have to manually start the web-server every time I power-up the virtual ...
0
votes
1answer
86 views

Which arguments are passed to init scripts during shutdown

I am currently looking at the startup and shutdown procedures for ubunut precise pangolin. As far as I understand at shutdown the system switches to runlevel 0 and all scripts with K* are executed ...
0
votes
4answers
148 views

SSH remote command execute stays without disconnect when finished execute?

I am trying to build a script/command that will restart our Asterisk/Elastix service on our PBX. The script is basically using simple command with auto log-in public key that run from Ubuntu ...
0
votes
1answer
101 views

Unigine Heaven run directly from terminal?

I think a lot of you would have benchmarked your Linux system using Unigine Heaven Benchmark 4.0. I know to run the it you can simply go to the Unigine Heaven folder and run the shell script file ...
0
votes
1answer
49 views

Script To Logout Root and Login User

I was wondering if there was a way to make a script that logouts of root or takes the automatic root login and logs in a user. This is for security reason so that the user cannot change important ...
5
votes
5answers
353 views

Needed simple script/loop/command for input command, execute and output within textfiles

Suppose I have list of commands in text file as below (cat cmdlist.txt):- cut lshw top awk sensors Now I want to get simple information on that command by whatis cut, whatis lshw etc. respectively ...
1
vote
1answer
248 views

sed “Permission denied” and “No such file or directory” errors while building Clockwordmod

Whenever I execute the command build/tools/device/mkvendor.sh samsung_aegis2vzw /your/path/to/the/boot.img I get this as the output build/tools/device/mkvendor.sh: line 83: /sedcommand: ...
14
votes
2answers
3k views

Installing breach browser

EDIT: Just look at the accepted answer. I wasn't how it worked at the time of writing so I just guessed below. I am new to Linux so this might be a noob question. I am trying to install a new web ...
1
vote
2answers
93 views

Specify password for sudo in script

I am making a script that will update my system (and do some other things, but that doesn't matter). I want the script to run sudo apt-get update and sudo apt-get dist-upgrade --yes automatically. I ...
0
votes
1answer
251 views

access to column in python like awk [closed]

This is my data file: Iam python newbie If I use awk to access columns element, that is easy just by $1. how can I access this columns element on python?
2
votes
1answer
138 views

Script adding launchers to the top gnome panel

For a large number of machines running 12.04 with gnome-classic. I'd like to script adding launchers to the top left of the gnome panel. I know how to add them manually but this is a tedious ...
0
votes
1answer
47 views

one column from output column on awk

Suppose which I have this table: one two three four two three four five three four five six four five six seven five six seven eight so I wrote awk -v word=two '$0 ~ "[^[:alpha:]]" word ...
0
votes
2answers
72 views

Prevent parameter expansion in shell script

Folks, I often have to do a recursive search in files. Tired of typing the whole "find/grep" combination all the time, I just created a script with the following line: find . -name $1 -exec grep $2 ...
1
vote
1answer
49 views

Pass variables to script which called script

I have a bash script which must call another bash script which varies per-user in order to get some configuration information, like so: somescript: #!/bin/bash ${HOME}/.ssconfig echo "Hello, ...
0
votes
1answer
38 views

In this script, ~ is /root/. How to be in /home/name-of-the-user/?

#!/bin/bash #become root UID=$(id -u) if [ x$UID != x0 ] then printf -v cmd_str '%q ' "$0" "$@" exec sudo su -c "$cmd_str" fi mkdir ~/.D3GO/; cp -a `pwd`/viewright_backup/. ~/.D3GO/; ...