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
2answers
26 views

How to start Crontab before login?

Basically I have a script (.sh) that syncs a local folder with an FTP one (using cron to run this). This script needs to be ACTIVE AT ALL TIMES (business use :D) and the only thing I cant control is ...
10
votes
5answers
2k views

.sh specifying extension?

Why is it some systems will run a .sh file just by specifying the file name without extension and others require name plus extension? In my case I'm trying to write a series of commands following ...
0
votes
2answers
46 views

How to write a recuring bash script

I created a program that requires a sequence of command line instructions to scrape new information and update the databases. Is there a way to automate this process so I don't have to type all this ...
1
vote
2answers
47 views

Execute a command stored into a $variable

I made a script where I wrote: COMMAND="/usr/bin/exiftool $PATH_NAME" .... code .... $COMMAND The variable $PATH_NAME is assigned dynamically inside a while loop. The command works fine until it ...
0
votes
0answers
211 views

java not found when running Ubuntu 16.04 desktop snappy app

When running this script from within a Ubuntu 16.04 desktop snappy application I get the message /usr/bin/java not found. Also, the application does not create the files and folders in my Documents ...
1
vote
2answers
50 views

Bash script help, check permission 755 on all files in a folder

I'm attempting to create a bash script where I check if all the files of a specific folder (/tmp) have the permission 755. I also need it to delete all the files that don't have permission value 755. ...
2
votes
1answer
34 views

How to run a parameter as an alias in a shell script?

I have an alias alias ll='ls -lF'; I created a bash script temp.sh: #!/bin/bash # Allow aliases to work in bash NON-interactive mode! shopt -s expand_aliases # .. and load them source ...
3
votes
1answer
72 views

Auto dimming laptop keyboard backlit when idle

On Windows 10, my laptop's keyboard backlit automatically turned off after a minute or so of inactivity. As soon as any activity occurred, they turned back on. On ubuntu, if I run the following echo ...
0
votes
1answer
20 views

Protect root-owned script against tampering and run unattended w/ sudoers' NOPASSWD

Using /etc/sudoers I gave a non-root user (anyuser below) permission to sudo-execute a root-owned script (test-script below) with the NOPASSWD: tag set. The script's permission octal value is 0550. ...
0
votes
0answers
12 views

Why Live Ubuntu terminal freezes at the end of disk cloning?

I had taken Ubuntu whole disk backup using dd command as: $ sudo dd if=/dev/sda* of=/dev/sdc* bs=512 conv=noerror,sync where /sda is computer harddisk and sdc is External Backup USB drive. Later I ...
0
votes
0answers
23 views

How to send email from script

I'm trying to write a script that will send an email with all the files from one folder attached, then move those files to another folder. I've done the latter bit with a bash script, but I've never ...
2
votes
2answers
67 views

Can I have a countdown window show the time until next suspend?

Occasionally I leave my computer unsuspended when I need to go somewhere but I am leaving it with people I absolutely trust and I will be back shortly so no real need to suspend (like if it's family ...
1
vote
2answers
62 views

vim.desktop - changes lost when terminal exits

I was thrilled to notice a GNOME launcher for vim in the vim-common package after I upgraded to Ubuntu 16.04, since it offers an alternative to gvim (a solid app, though not perfect for my workflow). ...
1
vote
2answers
72 views

Can I use the terminal to move images to specific dir's using the images 'tag'?

I have a huge folder of images that I've collected over the years that my students use for coursework. It started off with about twenty images so I didn't really bother with file names or any kind of ...
0
votes
0answers
19 views

The power supply of my external monitor broke, how can I switch on my internal screen?

Ubuntu version : 15.10 Laptop display : disabled External monitor Dell s2415h : enabled The power supply of my external screen is gone, so I can't see anything on my external monitor but the ...
2
votes
2answers
40 views

Create a script to move files that ignore errors

I can move files in the terminal easily enough. I have a whole mess of stuff submitted by students daily and it'd make my life a lot easier to have one thing I can run of an evening that'll move all ...
0
votes
0answers
16 views

Scripts (suddenly) not running from Nautilus

I wrote some scripts, set Nautilus to run executable text files without asking, set the files as executable and everything worked as advertised. I double-click my scripts, they open up in ...
-1
votes
1answer
19 views

how to find a folder based on creation time

I would like to write a small script that: finds the creation date/time of a folder on a server that creates a backup folder every two days with the date as 2016 04 22 as folder name remove the ...
0
votes
3answers
32 views

How can I use a script to get the IP address from ifconfig if the size of the IP changes in size with each connection?

I'm currently working with this IFTUN="$(ifconfig tun)" IPADD=${IFTUN:106:13} echo $IPADD But if the size of the IP address changes this isn't going to work anymore. inet ...
1
vote
2answers
32 views

How to see if a specific process is running or not for 1 hour in shell

My process name is test. If I use ps -ef | grep test I see that process is running. Now I want to check this every 10 mins for one hour and print success if it's running successfully for one hour. ...
0
votes
0answers
24 views

pacemaker corosynce lsb resource script( Sybase Database ASE Server and Backup Server)

I'm trying to create a lsb resource with pcs on rhel7.2 The "sybase" script is about Sybase Database ASE Server and Backup Server Startup & Stop & Restart $ status script The script is all ...
0
votes
1answer
23 views

Concatenate two paths

I want concatenate following: current_dir=/home/akshay/UCS source_dir=/lib/python2.7/lib-dynload/ I want to produce something like this: /home/akshay/UCS/lib/python2.7/lib-dynload/ and then I ...
0
votes
0answers
31 views

how to write upstart script for a background service (db)

I am on ubuntu 14.04 server and I am trying to write script for my database. i added this file to /etc/init/neo.conf: description "neo4j upstart" start on startup stop on shutdown script echo $$ ...
2
votes
0answers
35 views

Facing errors with running shell scripts at startup and poweroff

I am using Ubuntu 14.04 LTS and I want to run 3 scripts at startup. They are named as follows: voe.sh startUp.sh and runDown.sh The script voe.sh is the main file which will in turn call the other 2 ...
-1
votes
1answer
31 views

Some programs print errors to stdout instead of stderr, and don't set $? when an error occurs. Why? [closed]

See title. I've seen this twice recently, with both udisks and pacmd, and they are 100 times harder to script because of it. Why do programmers do this? For example, I want to switch the audio output ...
0
votes
0answers
46 views

How to make self-extracting executable (.exe in Windows) [duplicate]

I have created a script (Just some batch files) and compiled them into a .exe for ease of access. I have already converted said Batch files into shell scripts, how would I turn them into a single ...
3
votes
4answers
149 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
48 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
55 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
32 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
10 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
36 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
36 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
32 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
37 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
61 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
20 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
37 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
92 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
19 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
41 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
124 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
25 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
118 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
35 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
40 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
40 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
1answer
72 views

Command after apt-get install is not executing in script

I wrote a question on Server Fault, but I guess it's more applicable for this community. I'm writing a script which is meant to initially set up my Droplet. In the script, I'm opening SSH connection ...