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 (4)

0
votes
0answers
18 views

Make mouse automatically click at a color

This thread is totally not made for cheaters. So to be short, I want to make a script that auto-clicks when pointed at a color (like idk in games?) Oh and I also need it to work at full-screen apps ...
0
votes
0answers
27 views

How to run a unix script in Ubuntu14.04? [duplicate]

I am using Ubuntu14.04.2. I am new to linux and ubuntu. I am trying to install a tool (IsoDE; http://dna.engr.uconn.edu/?page_id=517) for RNASeq analyasis in my workstation. I have downloaded and ...
4
votes
1answer
35 views

How to make a daemon which checks if a program is running (at regular intervals) and starts it if it is not? [duplicate]

I am on Ubuntu GNOME 15.10 with GNOME 3.18, but I don't like the normal applications launcher so I have installed Docky, however often Docky suddenly closes and I am forced to manually restart it, so ...
1
vote
2answers
61 views

How to execute PHP code in Linux every 500 milliseconds?

I have an http server on Linux. I have some PHP code that stores variables into the cache using memcache and I would like to execute this code every 500 milliseconds whenever the server is running, ...
0
votes
1answer
52 views

duplicity: problem parsing WebDAV URLs in bash script

I am not a seasoned Ubuntu admin, so please bear with me if I am missing something obvious... Many WebDAV-providers supply usernames as "emailaddress@provider.tld". Although this does not seem to be ...
3
votes
1answer
39 views

How to avoid killing the wrong process in a bash script?

I'm writing a bash script that spawns a couple of child processes, and will be run by a cron job every hour. It's actually running an rsync command to a remote server, and the associated ssh ...
1
vote
0answers
12 views

Start a GUI in NetworkManager if-up.d script

I was wondering if it was possible to start a graphical application from a bash script when my openvpn is up. I was trying with command like this: gksudo -u username "sh -c '(/usr/bin/firefox &) ...
0
votes
0answers
24 views

Run Script on Sleep/Suspend Button instead of going to sleep

As on my machine in my office are running some services (like a server watchdog, etc.) I want to avoid putting my PC to sleep but blanking out the screens when I push the Sleep Button. The Command ...
0
votes
1answer
26 views

I created the file \.sh , am I in trouble?

I had a really bad idea: Curious about what could happen, I wanted to try to use various non-alphanumerical characters as file names. Think may have been a bad idea. I created the a file in the ...
0
votes
1answer
21 views

copying files from multiple directory to another multiple directory

let assume, I have two folders; folder_1 and folder_2. There are another 24 folders in each folder (folder_1 and folder_2). Each sub-folder of folder_1 contains 1 text file whose name is ...
1
vote
2answers
206 views

Get a specific word using awk

I am coding a script to check mysql databases using bash script, I would like to check if the status of a table is not 'OK', will return the table name and do some more actions: check.log table1 ...
0
votes
1answer
33 views

What is causing a script to run when I change to a certain user?

I have a certain user account on a box I'm working on. Whenever I log into or su to that user, a script comes up that restricts my usage of the server. This is intended and I wanted to modify it but ...
3
votes
1answer
98 views

Simple script for monitoring wireless status

I want to create a script that monitors the status of the network (I do not know if there are any programs that already do what I want to do even better). I'm only interested in monitoring the signal ...
2
votes
1answer
62 views

Upstart Script not catching mono application's start or stop

I've used the below script both with and without expect fork. It's purpose is to start a .exe file on start-up, and if it fails, to restart it. The mono application must be started by root/sudo to ...
0
votes
1answer
63 views

Copy files from directory if the name is present in a text file

#!/bin/bash while IFS='' read -r line || [[ -n "$line" ]]; do cd /home/Sud/Minimal\ Packages/All/ if [ -d $line ] then cp $line*.rpm /home/Sud/NewFolder/rpms/ else ...
0
votes
0answers
15 views

Launch a shell script with arguments from Unity “Dash Home” menu [duplicate]

First off, I know about lenses, and am in the process of beginning to write one for this, however this is "lowest hanging fruit" for the interim. My company uses unfuddle to manage tickets (similar ...
1
vote
2answers
51 views

How to store file information into an array?

With this part of script I can get a necessary information about files in my directory(and subdirectories). The only information I need is the extension and the size of file. for file in `find . ...
0
votes
1answer
37 views

How can i get this script working?

The Script(input.sh): echo "What is your name?" if [[ $1 =~ "*" ]] then read name1 read name2 echo "Are you really "$name1 "??? or" $name2 "?" else echo "Are you really "$1 "??? or" $2 "?" fi What ...
0
votes
1answer
691 views

How to Login to ISP Login Page by a Shell Scipt?

I have a ISP that randomly logs me out and my connection gets lost.So i want to write a script that automatically logs me in without user interaction when logged out (which i can test using a ping ...
1
vote
4answers
93 views

In Bash, how to read a file and take each line as incremental variable?

I have a file like below: (list.txt) 127.0.0.1 us 127.0.0.2 uk 127.0.0.3 cn 127.0.0.4 fr 127.0.0.5 ru 127.0.0.6 bd 127.0.0.7 hk I wanted to make an script which will show the user as items to ...
0
votes
2answers
16 views

export doesn't work [duplicate]

test.sh: #!/bin/bash export test_var=1 Run the script, then continue to run the command in the terminal: echo $test_var, I got nothing. Why? Since test_var was exported, I thought I could continue ...
1
vote
1answer
21 views

Cron keeps running each 1 or 2 minutes

I have noticed that my cron script keeps running each 1 or 2 minutes after execution for almost 1 hour, since I have a lot of cron jobs, sometimes I could not access to my website, the browser keeps ...
0
votes
2answers
33 views

Why isn't expr performing arithmetic on real number using in a shell script?

a=10.5 b=11.8 c=`expr $a + $b | bc` echo $c After execution, it's displaying an error message like non-integer argument. Why is this not performing arithmetic using expr?
4
votes
2answers
136 views

How to recursively and automatically convert all bmps to pngs in a given directory?

I have a directory on my machine with 100s of images in it, about half those images are bmps, and the other half are pngs... I need to make all the bmps into pngs, but as there are so many of them I ...
0
votes
1answer
13 views

Can I edit a Bios Setting with Linux?

I'm wondering to make a script for turning off battery charging, on my laptop bios have an option and it would be awesome if somebody tell me a technique to change that setting using a script. And if ...
0
votes
0answers
48 views

Running make on a Makefile returns a file not found error for files that exist in the same directory as the Makefile

So I'm installing the XRT Swift data analysis software. Currently, I am installing CALDB, and I am struggling with running the script to initialize the program. While the guide says there will be a ...
1
vote
2answers
26 views

Sending the {Return} key in a script file? [duplicate]

How can I send the Return key in a script file? I am installing all the PPAs from a script, and while it works, currently the addition of each PPA requires user input of the carriage return. ...
0
votes
0answers
27 views

Change Plymouth animation with script at boot time

I have Plymouth. I have a .gif file. I want to make that .gif to be my Plymouth animation at boot time with a script. Is that possible? If so, then what is the script I need to use? If not, then is ...
1
vote
2answers
41 views

Completely automated custom server installation with no internet - What are my options?

I need to perform various things on my custom ISO server installation during the first boot. It needs to be completely hands and internet free. What are my options here? I see the pre and post ...
0
votes
1answer
59 views

How do I automatically run a shell script at start up? [duplicate]

Situation: Whenever I boot up my Raspberry PI, I have to enter a few lines of commands to enable an interface. The commands: sudo modprobe batman-adv sudo batctl if add wlan0 sudo ifconfig wlan0 up ...
1
vote
0answers
22 views

Incorrect permission set received

In the following shell script: default_conf_file_path="/etc/apache2/sites-available/"; default_conf_file=$default_conf_file_path"000-default.conf"; DocumentRoot=$(grep "DocumentRoot" ...
3
votes
1answer
55 views

bash and sh output is different?

I have code to print the simple multiplication table of a given number. When I run it with sh it gives me perfect output, but when I use bash it gives a slightly different output. Can you explain why ...
1
vote
1answer
29 views

shell script error not able to find [closed]

I have this code and i am not able to point out the error. It is simple program to print table of the number given by user. Here is the code: #a function to calculate the table call() { #to check if ...
0
votes
1answer
15 views

session-cleanup-script not called

Because of this Bug I needed to edit the session-cleanup-script config in /etc/lightdm/lightdm.conf. As the same post suggests, adding session-cleanup-script=/etc/lightdm/lightdm.conf.d/cleanup.sh is ...
0
votes
0answers
30 views

Bugs with read and variables (busybox)

I have a //tiny// problem with my script: I cannot get the $key1 content. Basically, the script writes into /tmp/bios.sh, runs chmod +x on it and launches it (see result 1). The command set shows ...
0
votes
1answer
18 views

Bootup service is not starting all process Ubuntu

I need help with a custom service in ubuntu I want to run on bootup. But I get problem with the service, since it is not starting all processes. When I start the service manually it runs without ...
0
votes
0answers
31 views

How to run a Script by Autostart? [duplicate]

This is for a VPS running on ubuntu-14.04 64bit. NOT for a Ubuntu PC! i would like to know, how can i run a script on start (i know about the etc/init.d - but i dont know how to make my script look ...
0
votes
0answers
19 views

Unable to create a file in /etc/profile.d/ : Ubuntu 14.04 [duplicate]

I wanted to create a file oraclejdk8.sh in the folder /etc/profile.d/ according to the accepted answer given here. But in the process I am getting an error like this: ...
0
votes
1answer
22 views

Opening a file using xdg-open

I have a bash script which reads a file extension and list files of that extension using 'find' command. After that it reads name of the file. Now after this how can I open that file using name and ...
0
votes
2answers
31 views

why this shell script program is not working

echo "enter one no" read n rem='expr $n % 2' if [ $rem -eq 0 ] then echo "Number $n is even" else echo "Number $n is odd" fi while executing this program , bash is showing message like ...
-1
votes
1answer
45 views

Python: create variables using loop [closed]

how can I create a dictionary variables and every variable has an identical number using a loop in python if it is possible? for example: counter=0 for line in {1..5}: counter +=1 ...
1
vote
1answer
89 views

How to copy all current output in Terminal to a file when too large for clipboard after it has already been outputted?

I have a slight problem at the moment, I have a large amount of output in a Terminal (gnome-terminal) at the moment, so large in fact that the clipboard won't take it... So I wondering if there is any ...
3
votes
1answer
81 views

How to run an interactive script before xserver shutdown?

Every time I shutdown or restart my laptop (Ubuntu 14.04), I would like to run a script that checks, whether I pushed my newest code to my remote git repository. If I forgot it, then it opens a ...
-1
votes
1answer
64 views

calling bash command in python

i called bash command in python in subprocess.call, and the return should be a number for example 3, and in the output, it gives the number as output, but it doesn't put it in the variables for ...
-1
votes
2answers
198 views

How do I call a sed command in a python script? [closed]

Through python script, I am trying to replace a string by a string in a file using sed command. I do that through subprocess.call as it in the script. When I run the command in the shell script or ...
4
votes
0answers
65 views

How to Create A Startup Script for Keyboard LED

Freshly installed 14.04, CoolerMaster Storm keyboard. I'm not at all concerned with being able to toggle/turn off the LED, I simply want the LED to turn on before login, i.e. while looking at the ...
0
votes
0answers
22 views

bash terminal colors for directories/executables not working

I have colors on terminal but not for filetypes. I have a pretty heavy bash profile and rc: .bashrc- source ~/.git-completion.bash force_color_prompt=yes MYPW='mypw'4.8 Parallel Computing . ...
3
votes
3answers
81 views

How to prevent scripts/commands hijacking your session's cached sudo ability?

If I run a sudo command it will ask me for a password, however in that Terminal session for the next few minutes it will allow me to run sudo commands without asking me for a password as it will cache ...
0
votes
1answer
19 views

Ubuntu Mate question [duplicate]

I am running Ubuntu Mate 15.10-64bit on my surface pro by booting it from a USB drive. I don't want to install it on the surface pro, I just want to keep booting it from the USB drive. I always change ...
3
votes
0answers
48 views

How can I set a daily limit on a specific user's login time? [duplicate]

I need to restrict the use of a machine to two hours per day (total, across multiple sessions of being physically logged in at the console). Is there any way I can do that? Edit: I suppose I could do ...