Script is series of instructions written in plain text file. The script interpreter (i.e. shell, Python, Ruby, etc.) can read this file and act on the instructions as if they were typed at the command prompt. The interpreter also provides a variety of useful programming features to make your scripts ...

learn more… | top users | synonyms (1)

0
votes
0answers
12 views

I made a mistake with /etc/init.d

I copied a new script into /etc/init.d, then I did sudo update-rc.d ScriptName defaults (got a warning of missing LSB tags and overrides), I rebooted and I found a problem with the code in the script, ...
1
vote
3answers
27 views

How to add executable bash script on ubuntu startup

I have created a executable bash script (using chmod +x) for monitoring my system and it works perfectly with out any error. Now i want to add this script on my start up in order to executing the ...
1
vote
1answer
38 views

How to get notified (run script) on every SSH connection?

I'm able to run a script automatically every time I log into my machine via SSH by placing a command in the /etc/ssh/sshrc file. That works perfectly, however it's only triggered when I log in via ...
0
votes
0answers
20 views

sed error Bash script

So here's the deal I'm trying to do some auto editing of a file with sed in a bash script. Here's my code: systemdate=$(date) sudo mkdir "/tmp/autoupdate" sudo echo "$systemdate" > ...
0
votes
1answer
17 views

How to execute a script from trusted shell

I am new to Linux. I have copied the bash program from bin to a thumb drive. I have renamed it to "ebash". Now I connect this thumb drive to other Linux machine. I have mounted this drive and ...
1
vote
2answers
39 views

Script or program to log the disk usage

I would like either a program or more preferably a way to log the disk usage. In order to explain what I mean, when someone installs Ubuntu there are approximately 4.5 GB of disk used. Then when you ...
0
votes
1answer
33 views

Packaging bash script with dh-make

I have installed dh-make by installing other packages as recommended by this page which depend on it (I am listing all packages which could have installed it as well because I am not certain which one ...
1
vote
2answers
116 views

awk to compare two files, extract, output to third [on hold]

I've written a script in Python, but it's not fast enough for this job. I'm thinking line-by-line processing would work better. I have two files with two columns and potentially hundreds of millions ...
0
votes
1answer
34 views

shell script for wifi connection via terminal

How to write shell script that will automate interactive steps to connect to wifi via terminal? Steps outlined in How do I connect to a WPA wifi network using the command line? with further details: ...
24
votes
5answers
38k views

How to run an alias in a shell script?

I have an executable file mpiexec, whose full path is ~/petsc-3.2-p6/petsc-arch/bin/mpiexec. Since I want to execute this command in different directories (without having to retype the entire path), ...
8
votes
1answer
99 views

Workspace Stopwatch?

Is there a program that can serve as a workspace-depended stopwatch? I'd like to know how much time I've spent in each workspace every day. Edit: I'm using Unity.
1
vote
2answers
9k views

Why can't I write to a file even after 777 permission? [closed]

On my ubuntu server I have Apache and PHP, when I run a php file containing this code: <?php if(!file_put_contents( '/var/www/myfiles/folder/data/new_rewrite/531e5c5d1e16c3eae28b1489cd34ccb30', ...
0
votes
1answer
34 views

How to rebuild my PATH in script?

I have extracted my PATH to a file and listed it as such: /bin /usr/bin /usr/local/bin . /usr/lib/oracle/xe/app/oracle/product/10.2.0/client/bin /usr/java/default/bin /usr/kerberos/bin /usr/local/bin ...
0
votes
0answers
11 views

Unable to run red.cc file with my tcl script in ns2.35

This is my Tcl script set val(chan) Channel/WirelessChannel set val(prop) Propagation/TwoRayGround set val(netif) Phy/WirelessPhy set val(mac) ...
0
votes
2answers
27 views

Bash “move files” error message

I am trying to move some files based on a search pattern using bash but I get an error message. Here is the borrowed script format I used and the error message. Thanks! #!/bin/bash firstdir=dir1 ...
1
vote
3answers
970 views

How to run Shell script from HTML?

I'm somewhat new to Ubuntu Linux. I need to run the shell script from a html code. As I read somewhere like using Apache2 to generate a html and somehow I've succeeded to run a sh file from html, ...
1
vote
0answers
21 views

How do I run as bash script from a WebApp?

I currently am developing a custom Ubuntu dist. that runs a dedicated Kiosk app upon boot. I would like an easy method to shutdown from inside the Kiosk app, but I am currently at a standstill at what ...
0
votes
1answer
23 views

Script is not pausing until I type soff

The script is automatically calling the signoff script instead of pausing until I type "soff"? Also a user should not be able to start this script "signon" again while it is running. Below is what I ...
0
votes
1answer
28 views

DHCP on commit script not running

So I have a basic DHCP set up - option subnet-mask 255.255.255.0; option broadcast-address 192.168.0.255; option routers 192.168.0.254; subnet 192.168.0.0 netmask 255.255.0.0 { range 192.168.0.15 ...
0
votes
2answers
569 views

.sh installation error, this script is to be run as resolve user

Ubuntu 14.04 64 bit. I downloaded a .sh file that is supposed to install Davinci resolve but when i run it it says uncompressing installation package, and then says this script is supposed to be run ...
9
votes
4answers
357 views

Print output of code in the middle of the screen

The code below will output whatever in file word by word on the screen. For example: Hello will be displayed for 1 second and disappear. Then, the next word in the sentence will appear for a second ...
2
votes
1answer
10 views

Error in Bucket Brigade script I'm running

The brig start n command should create a bucket brigade of n passer processes in the passer script but when I run this script to begin the process I am getting the following error: ./brig: line 121: ...
5
votes
2answers
155 views

Total video time in a Directory

Is there a script(bash, python etc.) that outputs the total duration time of all video files in a Directory(recursively) ? For e.g on executing the following : script mypath it gives x ...
0
votes
1answer
25 views

Run a multi-line script in Screen

I want to run this script in a screen: #!/bin/bash while true do java -server -Xms2G -Xmx2G -jar craftbukkit.jar echo "If you want to completely stop the server process now, press Ctrl+C ...
5
votes
2answers
135 views

How to use zenity file selection

I am new to zenity and I am trying to make a simple script for loading a file using zenity --file-selection and the wc command to get the word count of that file. I have successfully made a form which ...
1
vote
3answers
380 views

How to install RevKit

I’m trying to install a software called RevKit on Ubuntu 12.10 and the following instructions1 need to be followed: RevKit can be downloaded from the www.revkit.org website. Opening a Bash ...
1
vote
0answers
29 views

Run a script after every grub-update

I want to run a script automatically after every grub-update. The script itself consists of a single line sed -i 's/[\]"!Windows 2006[\]"/"!Windows 2006"/g' /boot/grub/grub.cfg For this purpose, I ...
-3
votes
0answers
31 views

Print second vowel using provided loop!

FS=$'\n' for j in `cat $1`; do #Reads the text file in the centre of the screen echo " ___________________" echo " ...
0
votes
2answers
71 views

Print second vowel in word in red color

How do I print the second vowel in a word in red or blue color. Let say I execute my script called "script1" which reads a text file. My script should be able to print the second vowel in every word ...
1
vote
1answer
19 views

Using variables as paraments for commands in a bash script

I currently have a bash script which I can simply double click to remote desktop into my institution: #!/bin/bash xfreerdp -f -u myusername -d campus -p mypassword --ignore-certificate website.com ...
-1
votes
1answer
46 views

Display specific characters in specific time from a text file

How can I display a specific number of words or characters in a given time using a loop. Lets say I want to display 120 words in one minute. Here is the loop i have tried: FS=$'\n' for j in `cat ...
4
votes
2answers
187 views

Print only one line at a time from text file

how can I print or display only word from a text file at a time. When I run my script it should only display each word from the text file one by one, but only display that word. This is what I have ...
0
votes
2answers
47 views

How to Keep Text Consistent in A Shell Script

Good Day! I am creating a Shell Script so I can then use it to do X (Won't tell) This is my Current Script clear echo Ahmad A Kazi echo IDNO: BD_3456 echo echo Data Clear Program echo c 2015 Ahmad ...
2
votes
1answer
54 views

How to prevent pdf script code from executing?

Is there a setting inside Ubuntu Default PDF viewer (evince) or Okular to disable embedded script execution in PDF files ? It is a really important setting, that adds an extra security measure ...
-1
votes
3answers
36 views

Scripting Help to filter out an IP-address

I have a large text file that i want to extract lines of data from, i want to extract every line that contains an IP address that i can specify (z.z.z.z) 2015-02-26 00:00:00 Local3.Info x.x.x.x Feb ...
2
votes
1answer
9k views

Tomcat Installation startup.sh not working

So I've followed the list of steps on : https://www.digitalocean.com/community/articles/how-to-install-apache-tomcat-on-ubuntu-12-04. When I try to run the startup script, I get this message: ...
0
votes
2answers
167 views

How to add custom applications/scripts in startup applications in 14.10?

I'm trying to run a script automatically on bootup but am unable to do so because my Ubuntu Gnome 14.10 doesn't have a Startup Applications manager I can't add any custom scripts through running ...
0
votes
1answer
21 views

How to determine startup run level for Ubuntu?

We are planning to migrate from an older version of Ubuntu to (10.x) to the latest release of Amazon Linux. I'm trying to identify how to replicate the K and S scripts in the rc0.d, rc1.d etc ...
1
vote
1answer
24 views

How to write a bash completion to complete director names starting at ~/

Imagine I have a bash script called myscript that will only echo it's first argument, which will be a directory name. Example of usage: myscript proj1 Where proj1 is a directory for example located at ...
0
votes
1answer
17 views

ACL - only grant access to reading, *not* to execution

I have a directory called /test it there are two files: info.txt script.sh I want to grant read-only access to user john and did the following: setfacl -m u:john: r test/ With the above command ...
4
votes
3answers
3k views

Problems creating a desktop entry for a shell script

I did the following procedures to create a application launcher but it doesn't work. create shell script named shell.sh with the following content: java -jar foo.jar Added execution permission: ...
0
votes
1answer
150 views

Script to monitor Internet connection stability

guys. I'm an unexperienced Ubuntu user and I need your help. I would like to be reporteded everytime that the my router loses its internet connection. I mean, I would like to have my Ubuntu send me ...
0
votes
4answers
269 views

bash script which checks input to see if it is “y”, “n” or other - not working

I have written this bash script which is meant to check your input to see if it is y, n or something else (this will be part of a larger project): #!/bin/bash echo "Have you updated the PATH ...
0
votes
0answers
21 views

Update dynamic IP and fail2ban

i have a script running via cron to allow ssh only through some known IP's. Since my Home-IP is dynamically associated i use this script running every 15min: #!/bin/bash ...
0
votes
1answer
40 views

Problem in unmounting a disk image with a script… but not manually!

It is my first experience in writing shell scripts and something curious is happening. I'm working on an embedded system and I wanted my script test5.sh placed in the /root folder of the guest system ...
0
votes
1answer
15 views

Scripting question

How do I create a script that asks a user for a file name then creates that file? I have already tried this: #!/bin/bash #Get Script name of this file and create it #Get Author's name of this file ...
0
votes
1answer
41 views

Executable won't execute

I hope that my post is acceptable although I am actually running lubuntu, not ubuntu. I am trying to create an executable file but I am having difficulties. I created a script with a text editor and ...
4
votes
3answers
13k views

Proper way to add a user account via bash script

Here's the script code I'm using now: getent group $MYGROUP if [ $? -ne 0 ] ; then sudo su -c "groupadd $MYGROUP" fi sudo su -c "useradd mynewuser -p mypassword -m -g $PRIMARYGRP -G $MYGROUP" ...
0
votes
3answers
49 views

Files won't run as programs [duplicate]

After reading an answer on how to make a file run a command in the terminal when ran, I tried to do it myself. I made a new document, entered the following and saved. #! /bin/bash echo "this is a ...
1
vote
1answer
127 views

Copying contents of subdirectories in their parent directories

I have a list of jpeg files in a directory like this (below is just a sample, like the structure is the same but this there are many fo0# sub-folders, not only fo01 and fo02, where each of these ...