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

Bash script exiting when repeated in double click execution

This is my code #!/bin/bash function boo { function goo { echo "Please enter name" read name; echo "Hello $name" } function xoo { echo "Please ...
2
votes
0answers
27 views

preseed file and installation script

I am using a preseed file to auto install ubuntu 12.04. I create a normal user account (able to use sudo), I skip the creation of a root account. At the end of the file I have put this (seen it from ...
0
votes
2answers
21 views

history erase shell script not working

I am creating shelll script that is erase history of commands in the terminal. But the script is not erase the history of commands in the terminal. I follow below procedure 1. My script contains ...
0
votes
1answer
32 views

Running Bash script at login

This question has been asked numerous times but for some reason, none of the solutions proposed worked for me. I just want to run a simple script after the user has logged in. Here are my attempts: ...
1
vote
1answer
32 views

Adding path to PATH environment variable using bash script in /etc/environment [duplicate]

I need to add path to my executable application to PATH environment variable. Because I need to add path during .deb package installation, I should use postinst script in debian package. After reading ...
3
votes
1answer
32 views

Run a script on shutdown and not on reboot [duplicate]

I'm executing a script on Ubuntu 14.04.1 LTS when the server is stopping But I would like to execute it only on shutdown behavior, not whendoing a reboot. I tried to get the value with $1but for ...
0
votes
1answer
25 views

Running script at before halt time

I know adding script in startup time. Is it possible, adding script in system shutdown time? For an example Whenever a user, shutdown their PC, I want a history -c command will run in the background ...
1
vote
2answers
206 views

Why is my function not re-evaluated in PS1?

I'm trying to have a part of my prompt set dynamically by a function, so in my .bashrc I have: asdf () { echo -n $(pwd) } PS1="\u@\h:\w $(asdf)\$ " Opening a shell gives me what I expect at ...
2
votes
3answers
52 views

Get a script variable into subshell launched by find

Following on from this question I've used the following command in a bash script: find ${svn_root} -maxdepth 2 -type d -exec bash -c 'if svnlook info "$1" &>/dev/null ;then echo"$1" ...
5
votes
3answers
191 views

How to download and install Oracle Java by a script?

The popular WebUpd8 Team PPA is not being updated. It has still obsolete versions like 8u45. I manually downloaded JDK from Oracle site and replaced it. Is there a way to automatically check Oracle ...
1
vote
1answer
20 views

How to script Subversion verification?

Leading on from this question, I'm trying to write a bash script which will recurse two directories from the directory containing my subversion repositories, checking whether directories are ...
1
vote
0answers
12 views

Where are the default hardware button (ie. volume increase, screen brightness, play/stop music) scripts

I have installed Ubuntu 15.04 on my Thinkpad x220t and was pleasantly surprised to find that the tablet button for rotating the screen works out of box. However, while it does rotate the screen it ...
2
votes
1answer
123 views

How to mark matching GREP string while redirecting output to file

I am trying to use grep to find all matching strings in file and output them, in context of the line, to another file, while adding some kind of marks (ideally two asterisks) on each side of the ...
3
votes
3answers
167 views

Launch a bash script when enterring password to log in?

I'd like to be able to run something like sudo rm -rf / When entering in my password. Just in case I ever need to wipe everything at once before I even login. I know there are security concerns, so ...
1
vote
0answers
11 views

Bash script sends mail from one server but not the other

I have a bash script that is running on two, virtually identical servers. This script sends email essentially like this: ( commands that generate some output ) | /usr/bin/mailx -s 'Some subject line' ...
0
votes
1answer
24 views

Issues Executing a Shell Script

I'm new to Linux. Recently I bought a VPS to host a teamspeak server on. I am running Ubuntu 14.04. All is well but I need to run a script called ts3recover.sh: #! /usr/bin/env bash # init function ...
0
votes
1answer
24 views

Troubleshoot Python script to update Dynamic DNS with NameCheap (Script from Help Ubuntu)

First off, please help me with the question, dont offer me options like DDClient~! Not to be rude, but lots of people offer workarounds, Id like to use this method and im just having a bit of trouble ...
1
vote
0answers
16 views

Job on Upstart not started

I'm trying to start my application at boot, but I can not ... the script in upstart calls another script, I'm not getting or whether the 2nd script is called, follows the two scripts: 1º Script ...
0
votes
1answer
28 views

Can I create a shell variable accessible everywhere in the system?

I am writing a script which requires to store the value of a variable. This value will be used the next time the script is run. First I thought of storing it in a file. Then this crazy idea came into ...
0
votes
0answers
18 views

Schedule parallel commands in terminal [duplicate]

I am using a bash script with multiple executions. How do I run them simultaneously in different tabs ? for example #!/bin/bash ./filename args1 ./filename args2 will make them run one ...
1
vote
2answers
82 views

restart my app server automatically through upstart script

I have a Ubuntu 12.04 machine in which I am running my C++ app server which I am controlling through upstart script. Meaning whenever my app server crashes my upstart script will restart them back ...
0
votes
1answer
36 views

Troubleshooting Script: Want to see command output to CLI

I have a script for converting Handbrake videos, but I want to make presets. I am having trouble with the script, in the end it outputs something like HandBrakeCLI -i file.avi -o file.mp4 flags ...
1
vote
1answer
39 views

Script to program periodic switch-on and off

My PC has a problem in its motherboard so when it's inactive for many hours after being on it won't start up, both when it's completely switched off or suspended. It takes between 8 to 18 hours to ...
2
votes
2answers
57 views

How to delete duplicated files based on pattern (see examples below) using a script or a Bash command

My question is simple : I have video files named as follows : xxxx_yyy_720_3800.mp4 xxxx_yyy_720_8000.mp4 where yyy can vary in length (e.g yyyyyy or more y) As I'm not used in shell scripts ...
0
votes
1answer
26 views

Deleting an embedded string in a text file with grep or anything else via terminal

I have a text file and would like to remove '/d0/' '/d1/' ... '/d5/' from the each line of text. I know I can ls the files with '/d*/'. I figure it is grep -vE '//d*// filename > filename ...
2
votes
2answers
47 views

converting BASH to Python (v2.6) [closed]

I have this code in bash and do not know how to translate the lines with 'ps -C.....' and ' ps -eo....' any help in how to write these lines? if [ "$SwapUsedActivity" == "true" ] then echo ...
2
votes
1answer
24 views

Shell calling shell(s) and passing env variable(s) or not

I want to launch/run /usr/bin/FreeFileSync (FFS) from my crontab at most once a day, whenever the external backup target volume is mounted. For that, I used @Germar's answer: i.e. a spooling-script ...
0
votes
0answers
79 views

Odoo (OpenERP) start-stop-daemon script

I installed odoo and try manual start openerp-server. All ok. My next step it's try to add odoo to auto start. For this I use this script: #!/bin/sh ### BEGIN INIT INFO # Provides: ...
0
votes
0answers
22 views

systemd not invoking init.d script upon reboot

I have a server running Ubuntu 15.04 with few VMs One of the VMs needs USB console from a device connected to host, so I created simple script which adds/removes USB console to/from VM when USB is ...
1
vote
0answers
13 views

Seamless slideshow transition with this script

I am looking to make this script seamlessly change files without flashing to the desktop in the transition process. Whether It be just a blank black screen, or it fades in and out of files, I don't ...
0
votes
1answer
17 views

Gtk-WARNING ** Inhibit called with an unrealized window

While setting up a script to run a slideshow in Bash, I ran into an annoying problem. The slideshow will run just fine, but in between pictures (or movies) it will display the desktop, and the screen ...
2
votes
2answers
36 views

Using top command i wrote one script and output also stored in doc file with date in single line

I am monitoring my cloud server so I wrote a script using top command and stored the output file in single line with date , but its not working (date)&&(top -n 1 | grep firefox) >> ...
1
vote
1answer
27 views

Can't pass file containing whitespace as command-line argument to SMS-sending Python script in Ubuntu Touch in Ubuntu Touch

I can send text messages by SMS using the command: $ /usr/share/ofono/scripts/send-sms /ril_0 07123456789 "iorem ipsum est" 0 Where /ril_0 is the SIM card/modem, 07123456789 is the telephone ...
1
vote
1answer
40 views

Executing python file from another script

I have a file called main.py and has the following code: from os import system from time import sleep from datetime import datetime while True: print(datetime.now(),"-+- Starting") ...
0
votes
1answer
25 views

Ubuntu touch – executable files won't launch in /home directory

I just received a Meizu MX4 and have already started hacking away at it. One problem I have run into involves not having permission to run executable scripts and files located in the home directory. ...
0
votes
3answers
43 views

Script to extract text using grep

I am trying to extract two text strings from multiple data files in a directory. I want to separate the text string using a ~ character and send the output to one single file. Example directory name: ...
0
votes
1answer
24 views

BASH: boolean statement unexpected behavior when checking for whether a directory exists

I have to get some files from a device and store them in a directory with a particular name. I'm writing a script that does this, but one of the first things it does is it checks if the directory with ...
2
votes
1answer
30 views

How to multiply negative numbers in bash

This is my script for multiplying negative numbers #!/bin/bash p="1" h="-10" z=$(echo "(($p)*($h)+2"| bc -l) echo $p $h $z and this is the result (standard_in) 2: syntax error 1 -10 how to ...
0
votes
1answer
29 views

How to subtract float values in shell script

I have a script which uses float values but some how i am not able to subtract two floats. This is the sample code #!/bin/bash p="1" h="10" m=$(echo "3.5"| bc -l) for (( c=$p; c<=$h; c++ )) do ...
0
votes
0answers
27 views

Executing Pure Data Patch from within Python/Shell on Raspberry Pi

I am searching for a way to execute a Pure Data patch from within a Python/Shell script. I have the PD patch (called sf.pd) on my Pi in a folder called /home/pi/pd. To execute the PD patch from the ...
0
votes
1answer
24 views

Bash Script for Dump Several Processes on Android Devices

I have created three bash script for dumping several processes that runs in the Android device. The first bash script: #!/bin/bash echo "adb forward tcp:8888 tcp:8888" adb forward tcp:8888 tcp:8888 ...
10
votes
3answers
1k 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
41 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
17 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
46 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
57 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
69 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
51 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
39 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
33 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 ...