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

Cannot create dir, in bash script. Set a wrong variable?

HI I try to run a script for loadleveller on UNIX machine. My intention is to create script, which can create at first work directory on /gpfs/scratch/user/jobid where jobid is the sequential ...
0
votes
0answers
9 views

syntax error near unexpected token newline' doctype html ' while installing zpanel

I am new to ubuntu, trying to install zpanel on my VPS server.Found some questions with same problem,but none of them was applicable in my case. I have followed this answer to install zpanel, How to ...
1
vote
3answers
29 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 ...
0
votes
0answers
21 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
18 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
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 ...
1
vote
2answers
117 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
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 ...
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: ...
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 ...
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 ...
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 ...
8
votes
1answer
124 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
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
29 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 ...
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: ...
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
156 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 ...
-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 ...
5
votes
2answers
136 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
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 ...
-1
votes
1answer
47 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 ...
9
votes
4answers
359 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 ...
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 ...
-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 ...
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
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 ...
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 ...
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
42 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
4answers
270 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
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 ...
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 ...
0
votes
0answers
34 views

*beginner* > Beowulf cluster > How to run script along with command line in my cluster

I have a Beowulf cluster system with 1 master node and 3 slave nodes having Ubuntu 14.04LTS version. Now I need to improve the cluster performance in the matter of load balancing, latency, bandwidth ...
0
votes
2answers
38 views

replace string in a file with another where both are saved in variables

I want to replace a string found in a file with another string, but both have a special character (in this example it is a . char) e.g 1.0 and 2.0 so this the is command currently used: sed -i ...
1
vote
2answers
27 views

Splitting a string not working

I'm trying to split a string but there is something wrong. If anyone could please advise. echo -e "\e[41m## i = $i ##\e[0m" str1=$i | cut -d'/' -f1 echo -e "\e[41m## str1 = $str1 ##\e[0m" and ...
1
vote
1answer
37 views

How to execute a number of lines using xargs

I have a large sql dump that has 1 insert statement per line. I want to be able to pipe this to xargs so that I can slow down the writes. Basically I want to execute a number of lines, sleep, then ...
1
vote
1answer
37 views

shell script not working properly

I'm writing the below script but it seems not to work as this is the output: ## entered first loop ## [==1.0]: command not found [==2.0]: command not found ## entered first loop ## [==1.0]: command ...
0
votes
1answer
54 views

Making a Bash script to set desktop wallpaper as animated gif — what do these errors mean?

I was following this tutorial to see if I could make my desktop wallpaper in Ubuntu into an animated gif. In the tutorial, I copy and pasted a script that would supposedly allow me to do this. ...
0
votes
2answers
55 views

New to Linux: troubleshooting help with Ubuntu 14.04 issues

I am new to Linux and I'm having several issues with my version of Ubuntu 14.04LTS 64-bit. computer info: ASUS x200m touchscreen 11.6" original os: windows 8 current os: ubuntu 14.04lts 64-bit I ...
1
vote
0answers
47 views

bash script to cd into an USB device

i am creating a simple updater for a program which will be ran on an Odroid C1 with Ubuntu 14.04 Server.. Preamble 1) i want the updater.run downloaded from my server and placed into an USB; then ...
0
votes
0answers
15 views

Simple shell script for iPerf [duplicate]

We have an Ubuntu network in our test lab, and run traffic using iPerf. I want to automate the process a bit by writing out a script that would run the following from a terminal: iperf -s -u -P 0 -i ...
0
votes
0answers
23 views

system actions based on keywords in logs

I've been searching for an answer for some time but haven't come up with much. I'm wondering if there is a way to monitor logs in Ubuntu and then launch scripts based on keywords and/or input lines ...
3
votes
1answer
154 views

Bash script, arithmetic with floating point variables / strings that represent them

I'm trying to create a simple script that takes an average load percentage of the CPU each minute. I'm doing this by using the sar command from the sysstat package. Here is my current code: ...