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)

3
votes
4answers
130 views

Rename files to their parent folder

I want to rename file name with its parent folder name, adding the folder name before the current name. for example: Folder structure SOCH NC KT 633-ROYAL BLUE-MULTI | | 1.jpg | | 2.jpg | | 3.jpg ...
0
votes
3answers
43 views

string “if” statement comparing is string empty

I have problem checking if string is empty. I get first column of ls -l info and try to grep string searching for "x". If string is empty, I should countinue. But whenver string is empty or not, I ...
0
votes
2answers
35 views

Enter password only once for shell script

I have made a shell script to update & upgrade my existing packages all in one go. The script is: #!/bin/bash sudo apt-get update; sleep 10; sudo apt-get upgrade; sleep 10; sudo youtube-dl -U; ...
0
votes
1answer
30 views

Bash Automation without asking for password [duplicate]

How do I automate this without being ask for password every time it loops? #!/bin/sh for k in 2 3 5 10; do sudo ldconfig ######## # password asking here everytime python experiments.py done ...
2
votes
0answers
9 views

How to keep a local ~/bin folder up to date with updates from various Github repositories?

~/bin contains a number of scripts that I downloaded from various Github repositories for which the Ubuntu default repositories do not provide the latest version and/or PPAs do not exist. What are ...
1
vote
2answers
33 views

Saving work automatically when battery is low

I am a writer and of course I sometimes lose my work if the battery goes dead. I am looking for suggestions for ways to save when the battery gets to 5% or 1%. Maybe a bash command written to save ...
1
vote
1answer
31 views

I have 5 hosts which i need to ping if any one down i should be alerted through an email it is possible..?

I have 5 hosts which i need to ping if any one down i should be alerted through an email it is possible..? and it will be checked with every 20 minutes. can anyone help me.. Thanks in advance... i ...
0
votes
1answer
20 views

I need a script file for checking (ping) 3 ip address are working or not

I need to create a script for checking (ping) 3 ip address are working or not. using the crone tab and i do want to know how is it working. I was used a script using a test file, but i need to get the ...
0
votes
2answers
36 views

How can I make an icon which presses a key when double- clicked?

Is there any way to make a document/file when double clicked presses the Super key for example. I have no idea if something like this is possible on Ubuntu.
3
votes
1answer
43 views

Automating SSH login gives unresponsive remote-shell, dropping back to client-terminal (without errors)

I have a problem with the tool expect under Ubuntu 14.04 LTS. I want to automate ssh logins to some Sophos UTM Firewalls and evelate my rights directly after with "sudo su -" and the correct password. ...
0
votes
0answers
15 views

.desktop file not executing properly

I have a script that works very well in terminal by simply typing aprs.sh from anywhere. This script runs a few terminal based applications, and then runs a graphical application giving me a total of ...
0
votes
0answers
27 views

Running a Python script on an apache2 version 2.4 server

I have a python script (python.py) located in the /var/www/html/Python folder. The script saves some images to another directory (/var/www/html/Data). I have the x file permission on the python.py ...
0
votes
1answer
73 views

How to validate a user's password, with a shell script? [duplicate]

I'm making a bash script for the Ubuntu Terminal. I need to verify the user before the code can continue. How do I ask and validate their existing log-in password?
1
vote
0answers
14 views

xrandr reporting wrong resolution after booting from script started with upstart

I have a script in /home/username/.config/upstart myscript.conf ... description "my startup scripts" start on desktop-start exec ~/scripts/startup.sh start that startup script eventually calls ...
0
votes
1answer
45 views

Concatenate find command with other commans

I am trying to index my file system. What I want to do, is: execute the command find, and for each entry save the last access time, last modified time, compute the hash and other operations. In order ...
0
votes
2answers
28 views

crontab doesn't seem to work and makes different schedule in cron.d!

sudo crontab -e lets me edit the crontab, and I put in this: # Hourly backup 0 * * * * rsnapshot hourly # Daily backup 0 2 * * * rsnapshot daily # Weekly backup 0 4 * * 6 rsnapshot weekly And it ...
0
votes
0answers
18 views

Script to grab file which is downloaded automatically when site is visited

I need a script that would enable me to grab the file that is automatically downloaded when a particular site is visited. I have a PHP script that downloads a file once the link is entered. I need a ...
2
votes
2answers
98 views

How can I show an icon in the panel if (and while) a certain process is running?

I have a script that works in the background. I would like to show an icon in the panel (only) if it runs; it should not show if the script is not running, just like the Dropbox icon. How can I ...
0
votes
0answers
21 views

“Smart” update/upgrade script in bash

I have installed Ubuntu on my sisters computer. I know she will never touch the update icon. So I would like to make a script to perform update. But to disturb as little as possible, there are 2 more ...
1
vote
0answers
96 views

how to automatically copy new files from sd reader to disk on connect?

im new with ubuntu and linux, and poor knowleadge of english, sorry if i cant write clarely. I need a script or something to automatically move new photos (.cr2) from my camera's sd when i put it on ...
0
votes
2answers
31 views

exporting an environment variable from a bash script to a tcsh shell

I run bash scripts from tcsh shells. I want to set an environment variable in the tcsh shell from a bash script. The method of doing this, if your parent shell is bash is to source a file, i.e., ...
0
votes
0answers
32 views

SSH: Torch-Lua Script Unexpectedly Stops

I'm trying to run a Torch-Lua script on the luajit interpreter by using SSH on a remote (Ubuntu 14.04) machine. It runs only for two iterations and displays all the outputs accordingly, but, as soon ...
0
votes
0answers
28 views

How to check ssh tunnel status and create alert

Can anyone please help me to write a shell script checking ssh tunnels status and create alert in case a tunnel dies? Also some log must be created in var/syslog once a tunnel is created or dies. ...
1
vote
0answers
43 views

Command after apt-get install is not executing in script

I wrote a question on serverfault, but I guess it's more applicable for this commnity. I'm writing a script which is meant to initially set up my Droplet. In the script, I'm opening ssh connection ...
0
votes
0answers
14 views

Linpack test PBS output

I've downloaded INTEL Linpack test, and I want to run it through PBS script (specifically, run runme_xeon64 file, which contains the given number of tests and their properties). I create file ...
0
votes
1answer
33 views

Permission denied when running “./script.sh”, but works when running “bash script.sh” [duplicate]

I've got an issue executing a simple .sh file Here is my example : I'm creating a simple "abc.sh" file for creating a folder echo 'mkdir abc' > abc.sh According the executable bit chmod +x ...
4
votes
1answer
31 views

How To Program A Bash Script That Presses A Certain Combination Of Keys?

Please, i need someone to help me in making a very simple bash script. The job of this script is just to press a certain combination of keys on the keyboard. My objective is to create a script that ...
1
vote
3answers
203 views

How to squash all the contents of a multi-line file onto one line?

I have a file with many thousands (possibly even millions) of lines, however I need all of the contents to be on one line and all spaces removed (there shouldn't be any spaces there, but there might ...
2
votes
5answers
152 views

How to exclude one specific file from being hashed through bash script

I actually try to run recursive through a folder structure and make md5sum on all files into a single md5checksums file. Heres my script: #!/bin/bash rm -f md5checksums find -type f -exec md5sum ...
0
votes
1answer
18 views

First Bash Script Problem

I'm completely new to Bash, and I'm trying to make a simple script to automate Git pulling and pushing from a repo, but I can't get it to work. Here is a pastebin of the code: ...
0
votes
0answers
10 views

Script no longer running at shutdown

Before having upgraded to Ubuntu 15.10, I was running 14.04, I had a script which remotely backed up the code from my web server, and stored it in a new folder. This worked by running at shutdown, ...
1
vote
1answer
45 views

Help - Command/Script to calculate WiFi speed and save

Hello to all the community Few days ago, I asked the community to help me create a script. #!/bin/bash date=$(date --iso-8601=seconds) printf 'TIME (s)\tSIGNAL STRENGTH (dBm)\t\tTxBITRATE ...
0
votes
0answers
35 views

Bash script to display XKCD comic - crontab not executing

I wrote a bash script to display the current xkcd comic in my web browser (using the RXKCD package in R). I want to schedule this so that the current xkcd comic displays every morning at 8am when I ...
0
votes
1answer
34 views

Crontab entry to update my xmltv epg - xlm file - Ubuntu 14.04 LTS Server

I have made a small script like this:- #!/bin/sh tv_grab_uk_rt -output /var/www/xml/tv.xml and called it xml.sh. I have saved this script at /usr/bin/xmltvscript/xml.sh I can run this fine with ...
-1
votes
1answer
25 views

Purging custom .deb package through script exits suddenly

I am a developer, who sometime works on deployment related things. I am using Jenkins to auto-deploy my application to an ubuntu 14.04 machine. My application is packaged as .deb and some supporting ...
0
votes
2answers
54 views

Improving bash script

I need to improve this script: nmap -PN -p 9292 -sN 192.68.12.14 | grep "open" I need to check connectivity to ip 192.168.15.24 on port 9292. If the port is open, then print "port 9292 is open" ...
0
votes
1answer
30 views

i need to write a bash script to check a service status and restart

i need to write a bash script to check a service status. I need to look in the command output; /etc/init.d/ipsec status The line "1 tunnels up" indicates the service is up. If the line is not part ...
0
votes
0answers
30 views

Shell script for the following task?

so I have a question for a shell script and since I haven't really worked with it yet I want to ask for help here. My wife currently has to archive loads of screenshots and scans for her work. She ...
-1
votes
2answers
77 views

Joining 2 files and comparing them [closed]

I have two files where I want to use something like a left join that is used in SQL. File1: column1 column2 column3 column4 Ab Cd 100 Us Ef Gh 200 Us File2: ...
0
votes
1answer
50 views

How far can you go with CLI? [closed]

How far can you go with CLI? What sort of tasks can I automate? I would like to create automated scripts for home use for example I open up a terminal enter webbashexecute and then 5 web pages will ...
8
votes
3answers
1k views

Bash Script to Drag and Drop a File to New Location

I'm sure I'll get my ass handed to me for this question, but I just can't seem to figure it out. I'm new to bash scripting, so go easy on me... I want to be able to drag and drop a file onto a ...
1
vote
0answers
21 views

boot script table modified, please contact vendor

I installed Ubuntu and took away Windows 10 from my Lenovo G-50 . Every time I click on suspend the error shows up : boot script table modified, please contact vendor. It just restarts over again ...
0
votes
0answers
15 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
26 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 ...
3
votes
1answer
33 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
46 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
41 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
35 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
10 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
22 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 ...