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
8 views

Need help writing a loop for reconnect wifi after suspend

I have the problem of the wifi not reconnecting after a suspend in 14.04. I've looked at every possible fix in the forums. The best I can come up with is adding the following to /etc/pm/sleep.d : ...
0
votes
1answer
10 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 ...
5
votes
5answers
686 views

How to compare two files

So basically what I want to do is compare two file by line by column 2. How could I accomplish this? File_1.txt: User1 US User2 US User3 US File_2.txt: User1 US User2 US User3 NG Output_File: ...
0
votes
4answers
605 views

How to prevent script not to stop after apt-get?

I keep some bash snippets and copy&paste them when I needed for management. But I discovered apt-get cancels script execution. Here's my script where problematic. apt-get -y install gcc g++ make ...
1
vote
2answers
14 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
28 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 ...
8
votes
1answer
3k views

How do I make post-install scripts?

How do I make post-install scripts so when I reinstall ubuntu everything is as I want it? Things I want to achive: Installing PPA installing my programs themes needs to be installed Settings needs ...
33
votes
2answers
67k views

What is difference between #!/bin/sh and #!/bin/bash?

if I write, #!/bin/bash echo "foo" or #!/bin/sh echo "foo" both yields same. I have seen some scripts starting with #!/bin/sh or #!/bin/bash. Is there any difference between them?
0
votes
2answers
24 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 ...
17
votes
5answers
24k views

How do I tell a start up program to start minimized?

Here is a quesion that has been bugging me. You know how you can set up a program to run on start up right? Well, how can i tell it to start minimized, like you would do in windows? TeamViewer ...
-1
votes
1answer
27 views

run bash script from another script and redirect its output

Hi everyone I have to do a program.. I'll be really concise to explain it... And hat I've already done and what i have to do... Simply, I have to do a "simulator" in Bash that run exercises of ...
0
votes
1answer
20 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 ...
0
votes
2answers
32 views

End script and restart it with the same options and arguments

Usually !! repeats the last given command. But it doesn’t seem to work in a bash script. Is there a way to end a script and repeat it with the exact same options and arguments given the last time? ...
0
votes
1answer
25 views

problem occuring while creating .exe file

I'm trying to run test problem in the mfix but got struck with an error sh: 0: Can't open ../../model/make_mfix. bhaskar@admin2-Precision-T7600:~/mfix/run/tests/Added_Mass$ sh ../../model/make_mfix ...
0
votes
1answer
35 views

Run terminal command (python command) at start up [duplicate]

New to Ubuntu, but have looked everywhere to get this question answered. Found no solution so far. Basically I need to run two terminal commands on startup, which follow each other directly. This will ...
6
votes
5answers
10k views

How to start Virtual box machines automatically when booting?

I have many Virtual box machines in my Ubuntu12.04, each time i shutdown or reboot i have to start them one by one. I wanna a help in writing script for automatically autostart the VBox machines ...
1
vote
0answers
33 views

How do I open an URL from a bash script?

I have a simple script to start a node.js webserver and open the URL in a browser. However the last part doesn't seem to work, it wont open the URL in a browser (or anywhere else). This is the code I ...
-1
votes
1answer
25 views

Can someone kindly tell me what this line of script does [on hold]

I had this segmentation fault while trying to run a script. I will like to know what it means.Thanks ./start_enb.bash: line 202: 8746 Segmentation fault (core dumped) ./lte-softmodem -K ...
23
votes
3answers
1k views

Where should I put my script so that I can run it by a direct command?

Where can (should) I put my (bash) script so that it can be used (forever) by terminal or by a direct command: Alt+F2? I know there is /usr/bin and /sbin & /bindirectories but when should I use ...
2
votes
2answers
70 views
+100

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 ...
14
votes
2answers
1k views

What is apt-fast and should I use it?

Several times over the past couple years, I've heard of people using apt-fast for updating and installing packages, but I'm not really sure what it does. I think I've traced its origin to this forum ...
2
votes
2answers
63 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 ...
1
vote
1answer
31 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 ...
0
votes
2answers
2k views

Bash Script for custom message

I'm trying to send an email using bash script. I tried using the following in the bash script with no success as I execute the script it asks for CC: #!/bin/bash recipient="tarun@gmail.com" mail -s ...
0
votes
1answer
20 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 ...
0
votes
1answer
33 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
1
vote
1answer
18 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
22 views

Forcing letters in field only works in Chrome [closed]

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, ...
1
vote
4answers
6k views

How to open the default GUI text editor in Ubuntu or Lubuntu via a script?

I have a script that uses gedit to open text file in Ubuntu. That script does not work under Lubuntu. What command is required to execute the default text editor? I want to make the script usable ...
2
votes
2answers
63 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 ...
6
votes
3answers
19k views

How to automatically restart Tomcat7 on system reboots?

I have installed Tomcat 7 on Ubuntu 12.04 LTS which run on an Amzon EC2 instance. Now I wish tomcat should restart automatically on system reboot. I read this blog which suggest adding below script to ...
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 ...
1
vote
2answers
31 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
1answer
33 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 ...
0
votes
1answer
22 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
29 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 ...
28
votes
7answers
5k views

Repeat a command every x interval of time in terminal?

How can I repeat a command every interval of time , so that it will allow me to run commands for checking or monitoring directories ? There is no need for a script, i need just a simple command ...
2
votes
3answers
289 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 ...
0
votes
1answer
35 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
80 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 ...
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 ...
1
vote
0answers
56 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
42 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
29 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 ...
5
votes
1answer
759 views

How to create Excel xlsx files from a script?

I'm looking for packages available in Ubuntu main/universe repositories (14.04) able to create Excel 2007+ xlsx files from a script (python3 or perl) My requirements: 100% compatible Excel XLSX ...
0
votes
1answer
35 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 ...