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)

4
votes
3answers
79 views

running a script created in notepad (Windows) on Ubuntu

I created a Notepad file on Windows and copied it to Ubuntu. The file contains some iptables rules. After making the file executable using chmod +x and executing it, it didn't work. However, when I ...
1
vote
0answers
28 views

rc.local doesn't run on startup

I know this question has been asked a lot of times already, and I think I might have tried everything suggested on the internet, but I just can't get it running /etc/rc.local: #!/bin/sh -e while : ...
0
votes
1answer
14 views

setting up VOCE api in ubuntu

I am using ubuntu 14.04 . I recently downloaded a speech recognition and synthesis api called voce. For installation it told me to run the build.sh file. When I run this script it pops out some errors ...
0
votes
1answer
22 views

Add script to System -> Preferences -> Startup Applications

I want to run a script that changes the mapping of my keyboard from the startup applications. The script is in my home folder and it has permissions 755. I've created a new entry in System -> ...
1
vote
1answer
13 views

How to Install Handbrake and Convert recursive file tree's

Questions: Install Handbrake cli Create script to convert all files further down file tree from script Get example options from GUI Automate because I'm lazy [actually I just value my time :)]
1
vote
2answers
39 views

Bash script and escaping special characters in password

I have been reading a lot of questions already asked here, however, somehow nothing is working for me. I have a bash script where I have to send password which dump database on remote machine, so its ...
0
votes
3answers
26 views

Compress folders older than x days

In /opt/abc I have a path where a new folder gets created daily. In that folder a series of files gets created. I would like to run a script every Sunday at 02:00 and compress each folder which is ...
0
votes
1answer
18 views

MySQL Crontab Check

I have a serverpilot.io server running from digitalocean (1gb Ram), MySQL will crash once a week, the stats say the server is using ~256 mb out of 1 gb, but mysql will crash saying out of memory.... ...
0
votes
1answer
27 views

Bash Script to search a webpage

I've Googled my problem, and it's getting more confusing. I want to write a bash script that will search this page for a specific string and echo if it's found. For example, if I wanted to search ...
1
vote
0answers
18 views

Automatically switch to Singstar Microphones when they're plugged in

I am running a media computer for my sharehouse and since singstar has been so popular I want to run Ultrastar for everyone too. The problem is that getting the microphones set up can be finicky and ...
0
votes
0answers
34 views

Script for Opening Two Terminals and Execute Three Consecutive Commands [duplicate]

I intent to open two terminals and execute three consecutive commands in bash script. Basically, the first terminal will execute first command, second terminal will execute second command, and back ...
1
vote
1answer
25 views

Turn cron job commands into executable script that can run manually

I was running my crontab that backups some folders, but since then, I have started the practice of shutting down my computer at night, so I find that they do not run...go figure right? :-) So my plan ...
0
votes
0answers
34 views

What is wrong with my code so far? [on hold]

I'm attempting to make a DNA translation script in bash that will take an input file, iterate through the file, and convert every three characters into the proper protein code it corresponds to. Thus ...
2
votes
4answers
58 views

Remove whitespace from all array elements

I have a array called arrayvar, which is being defined as arrayvar=( $(awk '/'"$vovar"'/,/}/ {gsub("'"$vovar"'"," "); gsub("}"," "); gsub("{"," ");gsub(","," ");print}' temp1 | tr -d '\n' | sed ...
11
votes
2answers
446 views

Non-sudo alternative to /usr/local/bin for common scripts

I'm used to putting common scripts in /usr/local/bin so that I can execute them from anywhere with the terminal. For example, I make a shell script named 1, make it executable with chmod +x 1 and put ...
0
votes
1answer
67 views

A bash script to show logged off users [on hold]

Please help me create a bash script to show logged off users. It's easy to know which users are logged into a PC, the problem is to see those who are not, I have some time looking online, without ...
0
votes
0answers
28 views

Using sed to remove all lines containing special characters , numbers, and spaces

So I'm fairly new to using shell--bash specifically--and I'm in the process of writing a script which will translate files containing DNA sequences into a more useful format. Unfortunately, many of ...
0
votes
2answers
47 views

create scatter plot

file (1. arg) will create (scatter plot) for n. column (x-axis, 2. arg) and m. column (y-axis, 3. arg) function is called myfun sourcefile 1 3 for scatter plot of 1. and 3. column from file ...
0
votes
2answers
20 views

appends n-th line from the file x at the end of the file y

I have been asked to write a command that appends the n-th line (MYN) from a file (x)to another file (y). Here's what I've done so far: MYN=4 hey=$(awk 'NR==$MYN' x) echo "$hey" >> y But why ...
2
votes
2answers
130 views

How do I write a Bash script for this scenario?

I have these files in the directory home/acs. TBBN027162G_38d8-2f08-0c40 TBBN027605G_38d8-2f08-1518 TBBN027941G_38d8-2f08-0d1c TBBN027923G_38d8-2f08-35e4 I want to read TBBN027162G as service_id ...
0
votes
1answer
25 views

Try to execute a script (adduser.sh) in root /$

I'm a new user to Linux and been practicing using creating/using scripts in bash. I found a script to add new users automatically but when I try to run the script in root, I keep getting the same ...
1
vote
2answers
34 views

Make echo ignore spaces?

I have a file called temp1 sCellEventTrap-03-27 TRAP-TYPE -- CAC Code: 01 ENTERPRISE compaq VARIABLES { scellNameDateTime, scellSWComponent, ...
0
votes
0answers
13 views

OpenVPN --up called scrip does not work properly

I use such command to run my OpenVPN connection (part of script): gw=`netstat -rn|grep UG|awk '{print $2}'` openvpn --config ./openvpn.ovpn --up "./up $gw" >/dev/null 2>/dev/null& So I ...
0
votes
1answer
21 views

Ubuntu terminal runs script files as packages? [on hold]

Hi Ubuntu newbie here. Previously I tried installing something which would allow me to open packages through the terminal. However, when I go to run script files through the terminal, instead it ...
3
votes
2answers
57 views

How to execute a custom script when Internet reconnects?

My Internet gets disconnected every now and then. I'd like to run a Bash script every time the Internet reconnects. The script is quite simple: #!/bin/bash mplayer /home/user/sound.mp3 It's placed ...
7
votes
1answer
102 views

How can I send commands to specific terminal windows?

I'd like to write a script for opening multiple programs (servers) simultanously in separate terminals - doesn't matter which one - and assign different commands to different terminals with commands ...
0
votes
1answer
43 views

Run Python script with root privileges (not from terminal)

How can I run a Python script which, upon execution, brings up a dialog prompting the user for his root password - so that the script is run as root, being able to make changes to files within the ...
0
votes
2answers
43 views

Ubuntu can't find my bash-script at /usr/bin/

On my first Xubuntu I successfully copied my script trans.sh to /usr/bin, made executable and after that I can run it in any position of terminal, but my second Xubuntu can't find my script in ...
0
votes
1answer
17 views

running command on remote host by ssh fails when running inside script

The Situation: My Computer runs on Kubuntu 14.04. I am Admin of a Students House with some Netgear-APs. The idea is to have a script rebooting them all by one script. (ssh-key isn't posible) The ...
1
vote
0answers
18 views

Problem running backup script at shutdown Ubuntu 14.04.2

I want to run a script at shutdown, and a far as I can tell I've followed the proper procedures. The script (close) is supposed to launch another script (gdrive) in a terminal which prompts me to sync ...
2
votes
2answers
27 views

Executing wmctrl from bash

After playing a little from the terminal with wmctrl, now comes the next step. Execute wmctrl from a bash script. I do achieve to execute wmctrl in a bash when it is completely alone. Example: ...
2
votes
1answer
26 views

Flush Terminal Buffer?

I have a (proprietary) program which I start with ./program -a asdf in the Terminal. When I do that, I can see all the output at the right time. However, when I want to use the programs' output in a ...
0
votes
1answer
18 views

Help creating crontab to help with Disk Space Management IE: Delete files over 1 week old [duplicate]

I need a script I can call in crontab that equates out to --- find all files < 1 week old | rm files. I use macrium reflect free edition to back up my windows machines to a samba share ...
-1
votes
2answers
46 views

using a sudo command without a password for a certain app

I'm using a python script to run docker, but docker requires sudo commands to run and it's bad practice to store the sudo password in the file or give the whole python script sudo rights, I've seen a ...
3
votes
2answers
311 views

Tee doesn't get whole output from the pipe

I have a script executing commands like: export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH;./some_app -i $INDEX | tee $LOG echo "Number of errors: $(grep "ERROR" $LOG | wc -l)" The problem is probably in ...
0
votes
0answers
9 views

Read windows registry remotely via WMI or simular

Does anyone know if it is possible to read windows registry information from within Ubuntu, I realise this is possible using the Offline registry editor, but I want to read the data from a remote ...
2
votes
1answer
32 views

Is it possible to cancel or clear a notification created by a bash script using notify-send?

So I wrote a little script that makes sure a certain user plugs in a laptop when he logs on (it disables if he doesn't). The script uses notify-send to tell him to plug it in. If he plugs it in, the ...
0
votes
2answers
15 views

cron job wont execute the script

I have the below script #!/bin/sh tail -fn1 /app/agile/agile931/agileDomain/servers/01mustgagl01.natusmed.natus.com-AgileServer/logs/agileDomain.log| \ while read line ; do echo "$line" | ...
-1
votes
2answers
65 views

Help with script

#!/bin/bash a=`netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n | grep -v '1 ' | grep -v '2 ' | grep -v '3 ' | grep -v '1.1.1.1' | grep -v '1.2.2.2' | grep -v '127.0.0.1' | ...
1
vote
2answers
46 views

How to disown a chromium or chrome app on double click

I wrote a bash script to open an app (by double click) in my chromium. The code works but after opening the app when i close terminal the app also closes. I have searched through web and found out ...
0
votes
0answers
18 views

Where do I put Ubuntu server post install script files

Using the kickstart app, I can create a (I presume) bash script to run after the install finished in a chroot environment. If I have pre-writtren scripts and config files to copy over, can I include ...
0
votes
0answers
16 views

Install script as service running under speciffied user

I would like to install services into init.d folder in most standard way. Suppose I have script which should be run under specific user and starts the service (tomcat8 good example) ...
0
votes
0answers
14 views

How to run a script between login(entering password) and being logged on(showing desktop)?

Is there a way to execute a script when a specific user logs in; after they enter their password but before they are actually presented with the desktop? The script in question may lock the computer ...
0
votes
2answers
46 views

apt-get exits bash script after installing packages

I have read the answers in this post but it doesn't seem to work for my problem. I am executing a bash script via stdin from wget: wget -O - http://serverip/subfolder/script | sudo bash I've tried ...
0
votes
1answer
29 views

Using wget with Streamcloud and pages where you have to wait

I'm new to bash scripting and as I heard of "wget" I decided to write a script to download just the .mp4 file from a streamcloud (or whatever) link. I use it normally like: wget -q -O - ...
2
votes
1answer
35 views

How can I force a command to execute before an application starts running

I want to perform certain actions via a bash script before opening any application eg. firefox/ deluge/ VLC via GUI or CLI. The script should be executed only for certain applications and not for all. ...
0
votes
0answers
56 views

How to change MAC address “permanently”?

I am using Kubuntu 15.04. I was using macchanger eth0 -rto change my mac address. But there were two problems: Every time I disconnect and again connect to the network, the mac changes to the ...
0
votes
3answers
61 views

logout current user from script

I would like to create a script that: run some commands execute sudo su - [some other username] after I exit from [some other username] -> logout Example: test.sh echo "test script" sudo su ...
0
votes
1answer
25 views

How to pass a command with variables to at?

So, I'm making a bash script that's supposed to accept times and an extension from the user (through zenity) and schedule a call with sipcmd at the given time: extension=$(zenity --entry ...
3
votes
3answers
55 views

bash: populating array with elements containing spaces and special characters

I want to be able to populate elements of an an array with arbitrary strings, i.e. strings that may contain \ and spaces for instance. I wrote this : #!/bin/bash function populate_array () { if ...