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
68 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
62 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
2answers
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
121 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
236 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
149 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
94 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
36 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
292 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
68 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
192 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
280 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
85 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
66 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
85 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
134 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
99 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
46 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
352 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
242 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
89 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
224 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
135 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
65 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/; ...
0
votes
2answers
24 views

How to make a script that will make another script in the same folder executable?

How to make a script that will make another script in the same folder executable? I don't want to worry about path since it will be in the same directory. So it should be something like(i'm trying to ...
1
vote
1answer
32 views

Launch app with absolute path does not woks

I'm quite new in Linux environments, but for this one, I need help on bash. I'm on Kubuntu 14.04 x64 I have an embedded JRE for my business application , placed like this: app_root/run.sh (my ...
2
votes
1answer
148 views

How to write a script to run different application

I am very new to linux platform. Looking for a script file to call different application start up file located in different location and needs to be run in different terminals. For example : i ...
0
votes
1answer
186 views

How to open a bash script in Terminator using a command line?

so basically I have a program called Terminator and I want to open a .sh script, however, I don't run to run it as root, I basically want to have Terminator run the script, using another command line, ...
1
vote
1answer
89 views

Run the script file after 5 or 10 min after restarting the system

I have created a ruby script file that checks the connection present or not. For example checking port 22 is opened or not. Firstly I tried with cron job as follows @reboot find ...
-1
votes
1answer
93 views

Why can't I update my system via shell script?

I have a very simple script, let's call it update.sh: #!/bin/bash echo "Updating system..." sudo apt-get udpate sudo apt-get udgrade Running this script, throws the following error: me@host $ ...
1
vote
4answers
184 views

How to make Start up script for Making Application run on startup

I have one jar which i need to run on startup and no matter whatever user is logged in and that need to take that user name automatcally here this code can take user name echo $(logname) and this ...
1
vote
2answers
100 views

Unable to run shell script inside VI/VIM

I am trying to run a shell-script say test from vim #!/bin/sh echo good morning Now when I am using :!% I am getting a pop like shell returned 1 Press ENTER or type command to continue instead ...
0
votes
1answer
38 views

Subshell in script wont print corectly

Why does my shell and subshell only print the first hour in my for loop? It's supposed to loop through all 24 hours in a day but only prints the first hour correctly. { for D in $(seq -f "%02g" 1 ...
2
votes
3answers
58 views

automate multiple file conversions

I need help fixing my script to automate multiple file conversions. I am working on the server and I am trying to find a way to convert files automatically. The conversion needs to be made through ...
0
votes
0answers
33 views

How do I start a tmux window on startup and execute a scrips

I would like to be able to start my server and have a detached tmux window with a script running. So then I can attach with ssh and be able to work with the script. Thanks, Anthony
0
votes
1answer
45 views

Multiple background scripts in one command

I can run three scripts at once like this: python script1.py ; python script2.py ; python script3.py But when I try to run them all in the background, like this: python script1.py & ; python ...
1
vote
0answers
101 views

How can I draw selection rectangle on screen for my script?

I am trying to make a simple screencasting bash script. I want to get screen selection coordinates by drawing a red rectangle with mouse. I can use xdotools to get coordinates but how can I draw ...
0
votes
0answers
32 views

Issues with Grep [closed]

Why does the bottom line output "0" into the "AD-Results-$month-$Y" file? First grep command fgrep "$month $D $i:" $Filetmp > TempOutput Grep command to read "allows" from tail of ...
2
votes
2answers
365 views

Convert seconds since epoch to a human readable string

Command date +%s produces 1403568422. Is there an easy way to convert the 1403568422 to a human readable UTC timestamp? python -c "import datetime;print ...