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)

2
votes
1answer
78 views

Can simple scripts use GUI file manager to select file?

I have an extremely simple script that currently executes a command on a file located in the same folder: command ./file_in_folder option output. It would be better if script asks user which file they ...
0
votes
1answer
51 views

Network scanning script - cronification issues

This is (yet) another query about cron. I have referred to the guide on this site before posting here, but I still can't get this script to work. It is designed to suspend the PC when activity on ...
5
votes
2answers
450 views

Move multiple files to a dir if their names contain the same string present in dir name

I have multiple files in one folder: ABA.xy BEB.xy ACA.xy The same files with different extension in another folder ABA.rr BEB.rr ACA.rr Then I have single folder for each file name ABA BEB ACA ...
1
vote
0answers
71 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
23 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
136 views

How to run a tcl program/script [duplicate]

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, ...
0
votes
1answer
27 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
25 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
129 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
101 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
83 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
32 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?
0
votes
0answers
63 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
192 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
17 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
51 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
122 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 ...
2
votes
3answers
391 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
36 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
182 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
56 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
174 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
102 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
89 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 ...
-1
votes
2answers
84 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
45 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 only when the screen turns off. The reason is I have a LED keyboard and ...
1
vote
3answers
83 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 ...
0
votes
1answer
655 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
580 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 ...
2
votes
1answer
440 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 ...
11
votes
2answers
493 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
55 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
74 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
268 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
500 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
729 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
101 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
96 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
42 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
43 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
20 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
175 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
226 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
362 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
141 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
38 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
68 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
91 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
53 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 ...
0
votes
0answers
13 views

Script switch to Audio and HDMI when clicked

I have a pc with the HDMI cable always connected. I need a script to switch audio from HDMI to Analogic audio and viceversa. Can someone help me? :D Thanks