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)

1
vote
0answers
10 views

Ubuntu 12.04 LTS scripts in /if-up.d not executed

Since this morning have been trying to achieve something: System: Ubuntu 12.04 LTS, Network-Manager is not installed Goal: Every time, the eth0 network interface is started (if-up.d) we want to ...
0
votes
1answer
15 views

Implementing an if clause in simple bash script

I've got a bash script that makes use of cal -m $v where v is number . The user is prompted for v's value at the beginning of the execution . In case the user presses ENTER instead of introducing a ...
0
votes
2answers
25 views

How to run a tcl program/script

I have a small tcl script which I am trying to run. I have changed the permissions to allow execution of the script (although it did require sudo access to do so?) checking the Ubuntu Software Centre, ...
-1
votes
0answers
25 views

Opening a scoket in Kali linux using bash scripts trouble [on hold]

I know who to open a TCP or UDP socket in Ubuntu, by the following command : exec 3<>/dev/tcp/google.com/80 (for example) we can open a TCP socket on port of 80, but in Kali Linux there's no ...
0
votes
1answer
17 views

A problem when invoking a function in a bash script

I've written the following bash script to find a driver's name, I'd make it better but for now I just want to know why this script doesn't work ? #! /bin/bash ## the driver's name ...
0
votes
1answer
15 views

A bash scripting problem

In advance , I'd say I know the basic syntax of bash scripts but the following statement is not recognized for me : if [ ! -f /etc/debian_version ] could you help me what this condition going to ...
0
votes
0answers
24 views

how do i achieve executing a python script ON TERMINAL via a shell script in nautilus folder by the right-click>Script way?

Using nautilus i am writing a script which will run the python script which invoked it. So to run a python script i just need to right-click on it>goto scripts>select appropriate script and it will ...
0
votes
1answer
36 views

Why isn't Roundcube's Upgrade Shell Script Working?

I am trying to upgrade my Roundcube installation from version 1.0.4 to 1.0.5 and I cannot get the upgrade script working properly. According to Roundcube's upgrade documentation, the following command ...
0
votes
2answers
25 views

bash script dollar sign operator $ question - is it incompatible to ~ operand?

I am new to the Linux environment. After a quick search I could not find a helpful question about the $ operator used in bash scripting. I do not know if this question relates more to the Ubuntu (or ...
0
votes
1answer
12 views

Creating a script involving the memory usage of processes

How can one create a bash script that displays the sum of memory usage for the processes which have PID<100?
-1
votes
0answers
19 views

What you want to see in daily server monitoring mail?

I write bash script, which collect information from ubuntu server and send it by mail. With this script you can see: Your clamav antivirus information Which ports are open How many users in your ...
0
votes
0answers
24 views

the command argument is not passed to /bin/sh in popen

Here is a scenario where I use popen as FILE* stream = popen("Root", "r"); As per my understanding the Root argument will be passed to /bin/sh and interpretation is done. In my case, Root should be ...
0
votes
1answer
31 views

Autostart a Python script in an LX terminal

I have a python script which extracts continuous data from an incoming serial string and inserts the fields into an Sql database. The python script can be run manually from an LX terminal and works ...
0
votes
0answers
12 views

.xinitrc: can't reliably keep caps lock and ESC swapped

I use my .xinitrc file to run the following line: xmodmap /home/eric/.xmodmaprc. .xmodmaprc in turn contains the following: remove Lock = Caps_Lock keysym Escape = Caps_Lock keysym Caps_Lock = Escape ...
0
votes
0answers
16 views

How to run .py scripts with double clikcing [duplicate]

I have scripted a screenshot program with python. My problem is i am supposed to run it from ssh via python filename.py or via ./filename.py command. I gave chmod +x permissions but whenever i ...
1
vote
1answer
22 views

My script only opens new terminals when the previous command's terminal is closed

Sorry if my title is a little hard to understand, I tried to condense the issue as much as possible. I'm trying to run a bash script which opens a new terminal for each major command, that way I can ...
0
votes
1answer
30 views

gsettings not working from within bash function

Pretty New to bash and only 6 months into ubuntu so please bare with me. Im creating a post installation script https://github.com/jjdemitriUk/relutionDev everything is going well so far its written ...
3
votes
3answers
183 views

Sudo command in bash script halts the script

I have an early 2009 iMac with a sensor problem. The ODD and CPU fans run at full speed. To get them down to minimum speed in Ubuntu I need to set the speeds in the Terminal, using this method. Rather ...
2
votes
0answers
20 views

Where do I put a dyndns script for IPv6?

I am using: /sbin/ip -6 addr|grep -v temporary|grep 'scope global'|grep -oE '([0-9a-f]{0,4}:){1,7}[0-9a-f]{1,4}' to grep my global, non-temporary IPv6 address, that is advertised by my router using ...
0
votes
2answers
79 views

Script to find size of image files

I've got image files scattered all around my computer so I'd like to write a script that receives as input a full path to a directory, display the total size of image (.jpg , .jpeg) files in each of ...
0
votes
0answers
37 views

Modify PAM to run script at password fail

Today I've installed Ubuntu 14.04 LTS on my laptop and I decided to get a bit more control on who is doing what while I'm not around. So what I'd like to do is to modify PAM to run a script on ...
2
votes
1answer
147 views

Problem with executing .py script

I am a complete newbie in terms of using Ubuntu and I have stumbled upon this problem: I am trying to run this script: https://gist.github.com/mjkoo/0eb70888b6085b3f65f5 (it's basically a tool that ...
0
votes
1answer
26 views

Installing leiningen, how to move script to ~/bin?

I am trying to install leiningen to an Ubuntu virtual machine. But I am having a very difficult time because of my lack of Ubuntu/linux knowledge. I am specifically stuck on step two of the leiningen ...
1
vote
0answers
28 views

Requirements for KDE startup scripts

I'm running Kubuntu 14.10. I want to include the following startup script for KDE: kstart --desktop 1 firefox kstart --desktop 2 kmail kstart --desktop 3 konsole I placed these three commands in a ...
-2
votes
0answers
15 views

Moodle and php, bash [duplicate]

I write a spesial page in Moodle with buttons, which will be turn on another functions from my programm on server, for example send for spesial user email or anather action. How can i run programm on ...
-1
votes
2answers
54 views

bash comparison of integer always returns true?

I have the following simple bash script. for some reason it always returns true. #!/bin/bash service=hhvm status=($(ps -ef | grep -v grep | grep $service | wc -l)) if [[ $status -eq 0 ]]; then ...
1
vote
0answers
21 views

How to run scripts on screen sleep / wake

I'm wondering how to run a script when the screen times out and when it wakes. I am not talking about hibernate or suspend, but when only the screen turns off. reason is I have a LED keyboard and ...
1
vote
3answers
38 views

gksudo doesn't act like sudo for 'string' >> file [duplicate]

I'm trying to do a two-lines-script to temporary set a specific nameserver. Therefore I just output 'nameserver XXX.XXX.XXX.XXX' to the /etc/resolv.conf file, because it gets overwritten next time ...
-2
votes
1answer
90 views

How to make the “Steam key” on ASUS ROG laptop work

The dedicated steam key on my ASUS ROG G751 laptop does not do anything. What do I need to do to make it launch steam?
4
votes
2answers
435 views

Why isn't this script to delete part of my command history working on my computer?

The script can be found here: http://stackoverflow.com/questions/14750650/how-to-delete-history-of-last-10-commands-in-shell For convenience here it is: for x in `seq $1 $2` do history -d $1 done ...
1
vote
1answer
56 views

QEMU Connect physical disk [closed]

I made a windows virtual machine on my ubuntu pc using the following script (found online). #!/bin/bash configfile=/etc/vfio-pci1.cfg vfiobind() { dev="$1" vendor=$(cat ...
10
votes
2answers
373 views

Re-run an application script when it crashes?

I have some applications that need to run on my laptop all the time. I use a bash script to start these applications. In my script I have a loop that looks similar to this: while true; do ...
1
vote
1answer
21 views

Locate the id of input device and change the value of its property

I learned from this post that you can set mouse speed by the following: $ xinput --set-prop 10 "Device Accel Constant Deceleration" 4 where 10 is the id of the target device, which you can obtain ...
0
votes
2answers
33 views

Best way to schedule script, crontab or other options?

I never use crontab, and while it ask me for root password, I am careful. So my question is, I have to run periodically (let's say every 30 min)a simple script for analyze the text file, which is ...
0
votes
1answer
43 views

Is it possible to use variable in sed command in unix bash script [duplicate]

I trying to solve following problem. With great helps of others here, I can write and understand simple do loop in bash scripting. Now I try to do this: In "mein_directory" directory I need ...
2
votes
1answer
126 views

Alternatives for [variable = string substitution] in bash

I am learning bash and trying to understand the different ways of making a substitution and assigning it to a variable. Specifically, I'm changing Unix slashes ('/') to Windows ('\'). References: ...
2
votes
1answer
55 views

Bash Tab Completion: '-bash: unexpected EOF while looking for matching `)' -bash: syntax error: unexpected end of file

I'm trying to go into an irb session with specific environment variables from a file with this command: $ env $(cat env.sh) irb But when I try press Tab after I type env. to complete it, I get this ...
1
vote
2answers
54 views

how to fix my keyboard after a bash script messed it up

Okay, I was stupid. I ran a bash script I got off of some forum on the internet, github I think it was, that said a cool matrix would appear in the terminal, which did happen, but it also messed up my ...
0
votes
1answer
41 views

Used sudo command that I don't understand, want to undo it

I recently installed Ubuntu 14.04 for the first time, and I've been wrestling with various aspects of it since (mostly successfully), however in attempting to fix and issue with Firefox not playing ...
-2
votes
1answer
29 views

How does this lowercase expression works in bash

I want to convert a vaiable value to lower case. To do this, I am doing following lower_case_var=echo ${var,,} Above expression works fine. However, I am wondering that how it works?
0
votes
1answer
23 views

Is it possible to run a script on keyboard input language change?

I'm interested in running a script whenever I manually change the input language. This is because my xmodmap is forgotten whenever I change input languages, so a solution to that would also be useful. ...
0
votes
0answers
10 views

How can a Nautilus script be run for an empty directory?

I have a Nautilus script that can create multiple directories at once using mkdir with the option -p. The script is effectively the following: directoryStructure="$(zenity --title "make directory ...
1
vote
1answer
49 views

Setting python IDLE as default editor for python scripts

I'm using ubuntu 14.04 LTS and I have installed both python 2.7 and python 3.4 . I have tried everything here How do I set IDLE as the default editor for Python scripts? but its not working. Can ...
2
votes
2answers
87 views

How to rename file names to different encoding?

I have 3 types of file name encodings on reiserfs mounted hard drive: CP1251, KOI-8, UTF-8 and ASCII. I really need to convert all encodings to UTF-8, recursively. Is there any utility, which will ...
2
votes
1answer
92 views

desktop file can t run script in terminal

    I want to make a button on my lxpanel to launch a program that prints out in a pop-up lxterminal “Hello World!”, so I use the technique that I successfully implemented before ...
2
votes
3answers
101 views

Help to create a script to run on system startup

I have an Acer Aspire One 725. Turning it everything is fine except that the touchpad is not automatically activated. I dislike manually activate ... I want the command "sudo psmode" alone is ...
0
votes
1answer
25 views

Short keys to make a line comment in shell script Emacs?

I want to write shell scripts by using Emacs. I have already known to turn shell-script-mode on, but still don't know which short keys to make a line become comment. For example, which short keys in ...
0
votes
2answers
36 views

Bash: Regular Expressions in substitution

I have a bash script to substitute number values inside a text pattern. Suppose I have a file like this: word5word word55word And I want it to look like this: word125word word125word I have this ...
0
votes
1answer
59 views

How to end a cron started script?

I start a script via cron which works fine. But when i then try to end that script via cron (either killall / pkill / pgrep does work) nothing happens. If i let cron try to kill it or try it my own ...
0
votes
1answer
37 views

My bash script only opens editor, why doesn't it run? [duplicate]

I created a script to dd sdb to sdc on my older computer with Ubuntu 13. It ran when I clicked on it – asked if I wanted to run in terminal or edit it. On a newer computer, with Ubuntu 14, I created ...