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
23 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 ...
1
vote
3answers
273 views

How to install RevKit

I’m trying to install a software called RevKit on Ubuntu 12.10 and the following instructions1 need to be followed: RevKit can be downloaded from the www.revkit.org website. Opening a Bash ...
-2
votes
1answer
91 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?
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
27 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
26 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
18 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
0answers
25 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
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
1answer
38 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?
5
votes
4answers
15k views

Finding CPU usage from top command

I'm currently using top -b -d 1 > file1.csv to append the entire output to a csv file. However, I'd like the Cpu(%us) field alone to be entered in file1. I've gotten as far as this: top -b -d ...
-1
votes
0answers
20 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 ...
17
votes
6answers
15k views

How to start a terminal with certain text already input on the command-line?

Rather than rephrasing my question, let me describe to you the desired user-case: I create a short shell-script to run command "gnome-terminal --someoptionflagname 'my text to be posted'", and ...
2
votes
1answer
56 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 ...
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
14 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 ...
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
186 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 ...
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 ...
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 ...
10
votes
2answers
374 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 ...
2
votes
0answers
22 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 ...
8
votes
4answers
24k views

How to round decimals using bc in bash?

A quick example of what I want using bash scripting: #!/bin/bash echo "Insert the price you want to calculate:" read float echo "This is the price without taxes:" echo "scale=2; $float/1.18" |bc -l ...
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 ...
2
votes
1answer
8k views

Tomcat Installation startup.sh not working

So I've followed the list of steps on : https://www.digitalocean.com/community/articles/how-to-install-apache-tomcat-on-ubuntu-12-04. When I try to run the startup script, I get this message: ...
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 ...
0
votes
2answers
491 views

.sh installation error, this script is to be run as resolve user

Ubuntu 14.04 64 bit. I downloaded a .sh file that is supposed to install Davinci resolve but when i run it it says uncompressing installation package, and then says this script is supposed to be run ...
-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 ...
-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
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 ...
43
votes
3answers
92k views

What is difference between #!/bin/sh and #!/bin/bash?

if I write, #!/bin/bash echo "foo" or #!/bin/sh echo "foo" both yields same. I have seen some scripts starting with #!/bin/sh or #!/bin/bash. Is there any difference between them?
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 ...
3
votes
2answers
616 views

Script doesn't work when it is run using '#!/bin/sh'

I have a script that use shebang : #!/bin/sh, but when I run it in my Ubuntu 14.04 terminal, it doesn't work and it says that some lines has unexpected operator. My friend in another computer could ...
1
vote
1answer
57 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 ...
4
votes
2answers
437 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
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
34 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 ...
6
votes
1answer
4k views

Bypass “Do you want to…” dialog after clicking script

After I create a bash script and double click it in Nautilus I am prompted with this - Do you want to run "sleepytime", or display its contents? With Run in terminal, Dislpay, Cancel and Run as ...
5
votes
4answers
435 views

How do I make an entire directory executable?

I have an entire folder dedicated to python scripts. I'm tired of doing chmod on every new python script that I write. Is there a way to make every file inside my folder executable if it is a python ...
0
votes
1answer
44 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: ...
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 ...
-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
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 ...