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
37 views

git-dude script won't work as a cron job

So I have been using this witty Git desktop notifier called git-dude, except that I had the idea of daemonizing it, so I tried invoking it through cron in an allotted time frame, which is every 5 ...
0
votes
2answers
97 views

How can I run a Java program in background?

I try to make a init.d script which should start this java command: java -cp ./:/opt/glassfish/domains/domain1/lib/*:/opt/glassfish/lib/* com.name.it.svcimpl.OrderRequestDispatcher & With & ...
3
votes
1answer
42 views

When writing a Bash script, how do I create then open a file with the date as part of the name?

I want to use a script to open a list of URLs, then create an empty text-file called "[today's date].homework" and then open that text file in Vim. Here's the script I have now: #!/bin/bash ## Open ...
8
votes
2answers
2k views

Running .sh every 5 minutes

I have a .sh script that downloads a photo from Japanese satellite's server and sets it as a background picture. I've put it into startup list, but how do I run it every, like, 5 minutes, ...
0
votes
0answers
21 views

Create script that scans two files and automatically removes matching IPs?

I'm a sysadmin intern for a web hosting company and I'm trying to figure out how to get this task accomplished so I'll be as descriptive as possible. We have /etc/blockedips and /etc/donotblock I ...
0
votes
1answer
99 views

How to poll a variable while executing a script?

I want to continuously poll a boolean variable which i'm reading from a file while i'm executing a script. The polling have to start if the script starts (that part is working). Only i want let it ...
0
votes
1answer
23 views

Remove output from add-apt-repository, without hiding true errors

I'm trying to script that will automatically install some packages. One of the lines I have in the script is: sudo apt-add-repository ppa:brightbox/ruby-ng -y > /dev/null But try as I may it ...
0
votes
0answers
16 views

Keyboard shortcut that triggers action on a webpage

I have close to no idea where to start: I want to be able to use a keyboard shortcut that would make an action on a particular webpage. One example would be the following. I'm working with a text ...
0
votes
0answers
13 views

Multiple scp commands in bash script, but entering password only once [duplicate]

I currently use a bash script in the following format to update local data with remote one: usr=$1 scp -P 4444 -r $usr@some.other.machine.at:/some/folder/*Tools /home/localUser/someFolder/ scp -P ...
0
votes
1answer
36 views

Using read to simply short bash command

I am trying to simplify a small command I use for some video streams I use. I can successfully call the streamed video with the following: livestreamer -p mpv --crunchyroll-username="USERNAME_HERE" ...
1
vote
1answer
49 views

Command to ON/OFF cron job

Is there any command that can switch ON/OFF cron job in Ubuntu? As far I know to open crontab -e and comment out each cron job. Is there any single command to stop all cron job and restart later? ...
1
vote
1answer
48 views

is it possible to open files with a custom script by default?

I've created some scripts to run google chrome and other applications on ubuntu 14.04 using certain arguments. The problem is that when the program is executed for instance by double clicking a .html ...
0
votes
1answer
40 views

Anacron starts but does not run cron.daily

$ grep anacron /var/log/syslog Feb 20 19:05:11 jesus-Custom-PC anacron[1410]: Anacron 2.3 started on 2016-02-20 Feb 20 19:05:11 jesus-Custom-PC anacron[1410]: Normal exit (0 jobs run) Feb 20 19:05:13 ...
0
votes
1answer
37 views

Difference in formatting between a bash command execution and a script

I don't understand why there is a difference in how the output is formatted on standard output for identical commands run from within a script and directly from the bash. When I run ls -l from my ...
0
votes
0answers
28 views

force script to run in terminal emulator, with all arguments preserved

I have this bash function: runinteractive(){ if [ "$(tty)" == "not a tty" ] then x-terminal-emulator --working-directory $PWD -e "$0 $*" exit fi } For some reason the $* ...
8
votes
4answers
569 views

Ask for user confirmation before executing a script?

Is there a way to get User Confirmation(Like Are you Sure-Yes/No) type dialog box when I execute a script(by double click)? I don't mean in Terminal, but a Graphical confirmation box, something like ...
1
vote
1answer
36 views

/etc/network/interfaces static routes script

Is there any "scriptable" way to add static routes to the interfaces file in Ubuntu/Debian?, I don't want to use custom scripts, just the official way to add a "up route add -net...." to the correct ...
9
votes
2answers
821 views

Difference between $'$foo' and $“$foo”

I am having difficulties figuring out some the nuances between single and double quotes within a variable context I define: foo=pwd then run these: echo $'$foo' Which echos $foo (meaning the ...
2
votes
1answer
84 views

How use cd command to access a directory with space [duplicate]

How do I use "cd" to access a directory with a space, for example "XML 5.1 Final Fields" in a bash script I tried cd XML 5.1 Final Fields But it's giving the No such file or directory error. This ...
0
votes
0answers
12 views

Automate creation of content and sending mails from template and list of required variables

I have a list of so many users with their email ids Names Mohit Shrivastava Axyee Jackson ... Corresponding email ids mohitemail@domain.com axyee@domain.com ... I want to send all of them ...
0
votes
1answer
81 views

bash script to check website content by curl command

I want to write a script to check out if the website is working fine by checking out some of it is contents. If the content exists in the result, it prints a message telling the website is working ...
1
vote
1answer
45 views

Executing bash script via python gives syntax error

So, I'm trying to source a file via Python. The code goes something like this: import os source = 'source /home/software/cadence/release2013/setup/xyz.setup p' os.system(source) This gives the ...
0
votes
1answer
33 views

Set expire date for users

I use ubuntu 12.04, i have a file "user.cfg" and i put in this file the users like this F: user pass { enddate=2017-01-24 } This file existe in /var/etc/ Here's image of the file I want a script ...
0
votes
0answers
33 views

install composer in no-interactive mode

Because I create a VM Vagrant Ubuntu 15 with packer tool, I would like to install composer in my Ubuntu system with no interactive mode. For that I try this : curl -sS ...
3
votes
1answer
53 views

Execute command for a specific output of a command

I am interested in executing a certain command every time any program I run outputs "segmentation fault". Basically I have a bash script that writes the timestamp in a log file and do some other stuff ...
1
vote
3answers
72 views

Bash command substitution syntax (for script to determine my global ip)

I'm new to scripting and I'm stuck. I need to convert this: MYIP=`ifconfig eth0 | grep 'inet addr'| awk '{print $2}' | cut -d ':' -f 2`; Into this: MYIP=curl -s checkip.dyndns.org | sed -e ...
0
votes
0answers
66 views

“readlink -f” Working in Terminal, but not Working in Shell Script

I have current shell /bin/tcsh. I want to know the absolute location of a file, whose parent directory may be a symbolic link or may be a normal directory. So I am using readlink -f command to get ...
1
vote
1answer
113 views

Execute commands on a remote servers by 2 scripts

Currently I am using SSHPass in a script to connect to a remote server: sshpass -p PASSWORD ssh -o StrictHostKeyChecking=no USERNAME@1.1.1.1 and to execute any command remotely, I use: sshpass -p ...
0
votes
2answers
42 views

Run a bash script over network

I have a LAN which contains more than 50 ubuntu machines. I want to change entire LAN authorization with a centralized ldap server. I have a working LAN server, and i wrote a script to do all the ...
1
vote
0answers
71 views

How to run a golang restful api as service in ubuntu server

I need to run golang restful server that build using gin framework and mongodb as service in my ubuntu server.how can do this? (every time i run the go script i need to this also gvm use go1.4)
0
votes
1answer
66 views

change thunderbird's icon while running

I'm searching a way to temporarily change the icon of an application (thunderbird in my case) while it's running. I tried a dozen of addons, but none if them did the job. Is there a way to code this? ...
0
votes
1answer
51 views

Need help building shell script for copying

I have thousands of pictures (raw) in my computer sorted out into many folders and subfolders. I want to copy those into cloud drive. I successfully mounted to cloud drive. Due to my limited upload ...
3
votes
3answers
458 views

Bash script not recording

So, here i am, playing with some bash scripts, and there is something that doesn't work: #!/bin/bash script -c \ sudo apt-get update && sudo apt-get upgrade && exit echo "(Not ...
3
votes
1answer
62 views

script to concatenate multiple text files found in zip archives nested in multiple folders

I have 30 gig of text files and html files from various sources laying in a nested folder hierarchy. All these folders are in my home directory in a folder named zipFiles. The hierarchy is 20 levels ...
4
votes
2answers
134 views

How to close terminal from a bash script

I'm new on this forum and with Linux. I'm trying to make a simple script what will open a new terminal with a new name, and close the old terminal from where the script was running. The problem i ...
1
vote
1answer
63 views

sh script works manually but not via cron

I have a cronjob created using this tutorial: http://www.matt-helps.com/automatic-backup-of-mysql-database-to-s3/ It works when i run this command sudo sh s3BucketBackupScript.sh But I can't get it ...
0
votes
2answers
27 views

find does not go through all files in folder structure

I want to convert a massive bunch of wmf files (120860!) to svg in many subfolders (27 subfolder with many sub-subfolders each). I have this bash script that does for i in `find -iname "*.wmf"`; do ...
2
votes
3answers
190 views

replace a string by variable in a file using bash script

through bash script, I am trying to find a value-number- from a text in a file, then make a new variable then replace it with a string in that file for example. in a file in /root/test.txt , i have a ...
2
votes
1answer
92 views

How can I queue failing or missed backup jobs, even if the computer is asleep or off?

I'm thinking about using rsync to backup my laptop to my home server via ssh. I want to do it daily so I plan to use crontab. My question is: if a job is missed (say the backup is scheduled for a time ...
0
votes
0answers
94 views

Color coding the terminal with ANSI R,G,B

My question is where would be an appropriate place to share the below script? r=0 g=0 b=0 while : ; do for ((r=0;r<6;r++)); do color=$((16+36*r+6*g+b)); printf "\033[38;5; ...
0
votes
1answer
14 views

How to get pulse sound level

I'm using simple keyboard shortcuts to adjust sound level on my fluxbox 123 :Exec amixer sset Master,0 5+ 122 :Exec amixer sset Master,0 5- However I'd like to add some notification (notify-send) ...
3
votes
1answer
25 views

How to make lockout screen script for ubuntu

how to make lockout script for Ubuntu. basically I want to create script and schedule it (cron) and I want computer to lock screen everyday in: 13:00 14:00 16:40 any help would be nice. thanks.
-1
votes
1answer
103 views

run startup script which requires a xserver session

I have a python3-script which uses the Gtk-module (imported from gi.repository, for recent-manager functionality), requiring a link to the current xserver session (lightdm service in Ubuntu). Running ...
0
votes
1answer
32 views

Unable to start a cron task as root

I use a program to check raid status. The command is megaclisas-status. Here is the issue : Has user /usr/sbin/megaclisas-status return : This script requires Administrator privs => OK Has root ...
0
votes
0answers
88 views

error: 'xxx' directory does not exist

I'm trying to compile a file by using the Allwmake command. but i got this error in my terminal : mohsen@mohsen-MS-7599:~$ ...
0
votes
0answers
54 views

Executing .sh file for Vassal engine returns “java: file not found”

I just installed Ubuntu, after having used Linux Mint for a year or two. I was hoping to install and use the Vassal strategy game engine (from vassal.org), which worked fine in Mint LMDE. However, ...
0
votes
1answer
57 views

Odd Illegal Variable Name error in csh script

I have a peculiar problem with a csh script which occurs only in my Lenovo Z500 laptop. I have run the script in 3 other computers with analogous operating systems (Kubuntu 14.04 x64) and the only ...
1
vote
1answer
88 views

How can I make sure a program is killed when VPN is running?

There is a program that I need to not have running whenever my VPN is running. I don't want to resort to closing it manually every time, because I might forget sometime. I would like to guarantee ...
1
vote
0answers
10 views

Shell script to create multiple accounts? [duplicate]

I'm looking for some help with a school project which needs a shell script to create 10 accounts (5 teaches and 5 students into different groups) along with respected passwords. I'm a true ubuntu noob ...
0
votes
0answers
43 views

script to move files from downloads to other folder (every time a file goes to the download folder)

My goal is to make an script which prompts up a "save as" windows every time a file falls on the download folder, and allows me to move that file to a selected folder.