A script is a sequence of commands or instructions that are executed by an interpreter program rather than compiled into a standalone executable program.

learn more… | top users | synonyms (2)

1
vote
0answers
45 views

Task Automation With .EXE program and Bash Script?

There's a Windows program called Visipics. It finds similar images, not merely duplicates. I find it superior to findimagedupes (I use it with Manjaro and Linux Mint) and competing Windows programs, ...
-1
votes
1answer
35 views

Adding Function to array based on index [on hold]

I am using Bash. I am trying to add a function to an array. I tried using: if [ $CONTROL -eq 0 ]; then array[$index]+=`function_name1` fi if [ $CONTROL -ge 1 ] && [ $CONTROL -le 20 ]; ...
-3
votes
0answers
33 views

Script (shell or python) to update a web page every 5 minutes [on hold]

I'm trying to write a script (shell or python) to update a web page every 5 minutes. I tried this: import time from selenium import webdriver driver = webdriver.Firefox() driver.get('https://www....
0
votes
1answer
28 views

How to call a script from one file location in another bash script

I have a script named initTEST.ora at location $ORACLE_HOME/dbs. I want to call initTEST.ora script in another script named test.sh which is present in /home/oracle/script.
2
votes
4answers
60 views

Add something to crontab programaticaly (over ssh)

I have a deployment script, it must add something to a user crontab (trigger a script that clean logs every XXX days), however this must only be done during the first deployment, or when it needs to ...
5
votes
2answers
385 views

Shell script: if multiple conditions

I want to create a shell script that echos something if 3 directories don't exist. Here is the code I wrote: test.sh: if [ ! -d "/home/unix/POSTagger2" ] || [! -d "/home/unix/POSTagger2/stanford-...
0
votes
1answer
58 views

Sourcing a file multiple times in a bash script

I have a large configuration script (bash) that is pretty well modularized into separate functions to complete a bunch of tasks for installing/configuring a new rollout of a software suite. We have ...
0
votes
1answer
29 views

Backup Script throwing errors

I have the following script: #!/bin/sh #Finds all folders and subsequent files that were modified yesterday and dumps them out to a text updatedb && rm /tmp/* echo $(locate -b `date --date=...
0
votes
1answer
25 views

cannot open file as first argument [duplicate]

I am trying to run a script like : ./script.sh file but I am receiving ( if I use a txt file ): =: cannot open `=' (No such file or directory) test.txt: ASCII text Second If I use a gz ...
1
vote
1answer
31 views

Bash scripting [keyboard input needed] [duplicate]

I'm new in Linux and I'm trying to make my first bash script to improve my work at college. Im working with a software called GROMACS and I'm trying to make a script to perfom a bunch of codes at the ...
0
votes
1answer
30 views

How to run a perl script inside another perl script

I have two Perl scripts and want to use one script from another. The scripts are called script1.pl and script2.pl. I want to run the below command inside script1.pl : /home/user/script2.pl /var/log/...
1
vote
1answer
36 views

xterm not loading xresources properly

There are similar questions out there, however, I was not able to figure out the flaws in my .xinitrc file which causes .Xresources not to load. The respective .xinitrc #!/bin/sh [[ -f ~/.Xresources ...
3
votes
0answers
60 views

Performance Optimization

I have one script which roughly has to read 1.5 million lines and process the lines and print out output in cvs file. This script is current taking more than 8-9 hours to process 250 thousands lines. ...
2
votes
3answers
173 views

How to remove all lines that have one value in the line?

I have a file as the following input file 0.0 4 6 5 1 2 9 4 5 1 ..... 0.25 0.5 3 1 1.0 3 7 8 2 1.5 3 3 3 4 6 4 5 2.0 2.5 6 7 6 9 I want to delete all lines ...
3
votes
1answer
25 views

Print proper log file from a terminal session

I am trying to log a terminal with the ssh user@ip | tee -a test.log command. But, when I push backspace it prints in the log like: pwe[J[J[Jexit (for example). Is there any specific option ...
0
votes
1answer
25 views

Execute script in new tab command line gnome-terminal

Hello i want to open a new terminal and execute a script immediately to it (to set a title in the new tab) and i cannot configure this. I try: gnome-terminal --tab-with-profile=$varname -x ./test.sh -...
-1
votes
2answers
33 views

Privilegies of command inside shell script

I need to run simple script to check host status (ping), I have following script: #!/bin/bash echo "Host checker:" if [ "`ping -c 1 172.17.10.1`" ] then echo "HOST UP" else echo "HOST DOWN" fi ...
1
vote
5answers
89 views

Killing a named process older than X minutes? (no killall -o)

Okay, first post! So I have this situation where I need to check for a process older than 5 minutes by a particular process name. The problem is that the system in question is a customized version of ...
1
vote
1answer
35 views

`Interact` not working as expected in bash/expect scripting

In order to provision an embedded device (i.e. writing images to flash) a series of very well known commands have to be entered during the boot stage. The algorithm is something like: Capture a ...
0
votes
1answer
33 views

Automatically put content in for read in bash

Hi I have a little bash script and before i used to type the content in a bit like answering a question, but what i would like to do is just run the bash script and instead of answering the question ...
1
vote
0answers
32 views

Integration of `afuse` with `sshfs` as a (systemd?) user-daemon spawned from login or first shell

To facilitate working with remote files, I setup afuse with sshfs to run from my .bashrc. It works, after bash init all my remote trees from ~/.ssh/config/ are mounted on-demand under ~/scp/, but ...
-1
votes
1answer
34 views

cancel script execution and continue [closed]

I have a script which runs another script. myscript.sh #!/bin/bash .... cd /folder/ sh run.sh sh another_script ... the procedure: So , I start running myscript.sh , the script runs it's ...
14
votes
3answers
417 views

Replace environment variables in a file with their actual values?

Is there an easy way to substitute/evaluate environment variables in a file? Like let's say I have a file config.xml that contains: <property> <name>instanceId</name> <...
1
vote
2answers
59 views

chown doesn't work through script

I have a script: #! /bin/bash sudo chown -R $USER:$USER /opt/Folder The chown doesn't seem to execute. If I just write the above line from terminal ,it runs fine though! I have read this but ...
0
votes
2answers
24 views

Bash scripting: Change standard error message for custom one

I have been trying to work on my own little backup script. I am running into an issue when I run my script and the rm command has nothing to do. I would still like to process the output (aka display ...
4
votes
1answer
44 views

Open a new terminal, monitor it and execute a script

I have a script that I want to monitor its results and write them to a log file. I run the following: gnome-terminal -x bash -c "script logfile.log; ssh user@IP" But this command execute first the ...
2
votes
0answers
50 views

Bash completion extra space when adding file directory

I have a script for extending bash-completion for certain commands. If I type command1 and do a tab, it should auto-complete with a file directory (and the files). It works fine expect for one ...
1
vote
0answers
38 views

ImageMagick + ruTorrent-stats (Github repo)

I am trying to combine information I found here on the Unix & Linux Stack with I Wim Leers' rutorrent-stats I have some experience with coding simple websites and while I am by no means a ...
0
votes
4answers
58 views

Find folders that begin with the same string

I have more than 1000 subdirectories in a folder. Some of them begin with the same string and I want to find all directories where the first 5 characters of their name are also the first 5 of another ...
-1
votes
0answers
12 views

triggering file transfer with a criteria for time and validity of file with the specific words

i want monitor directoryX/folderA for new files and trigger a copy of all those files that have a specific list of words/ headers in the first line of my file to a different directoryY/folderB . And ...
0
votes
0answers
20 views

find lastly zipped file in a directory which has so many zip files [duplicate]

I am trying to make a script in that i need to execute a command which can give me the lastly zipped logfile(ex:my log file is going to be zipped toady so i need to place this file in script.likewise ...
0
votes
0answers
55 views

service doesn't work

Background I am using this script in order to make my script running as service. I am using Linux Mint 17.3 Rosa. The problem Sometimes the start/stop works sometimes not. Sometimes, I have to ...
1
vote
1answer
60 views

KSH script having trouble reading in variables line by line

For starters, I'm not the most advanced scripter. I was asked to create a script that would search through a directory for print files older than 14 days and move them to an archive directory. There ...
0
votes
1answer
27 views

update lines in a file

I have a file,where it has some fields.For example, var One = "fcb"; var Two = "abc"; How can I update/replace these lines using a script? I want to be able to do something like : echo -n "...
1
vote
2answers
22 views

Merge PDF document but with conditions

I make bus timetable booklets for drivers every day, and I have 4 PDF files: Special Instruction Sheet (Every day different) Bus daily timetable (which is always different) Bus Assistant daily ...
2
votes
2answers
44 views

Best way to ensure that a script is run once a period?

I need a certain script to run once a month (others viewing this question may need it to be run once a day/week/year/5-day, etc). I know I can use cron to do so with: 0 0 1 * * ./script.sh But what ...
0
votes
0answers
58 views

Curl gets 200 OK, while browser shows 503

I have a bash script: code=$(curl -I -s -S --resolve $host:$port:$ip $link | grep 'HTTP/1.' | awk '{ print $2 }') if [ $code -eq 502 -o $code -eq 503 -o $code -eq 504 ]; then /usr/sbin/service ...
0
votes
4answers
68 views

How can I run a command periodically and indefinitely till it's turned off?

I want to run a command every several minutes until I turn it off. After some searching, I found lots of ways of doing the first half (running a command periodically and indefinitely), what about I ...
0
votes
2answers
45 views

SFTP to upload files at cronjob

I want to use SFTP to upload files from A to B. path for A: /tmp/A path for B: /tmp/B server B has own username & password. my cronjob will run every 10 mins to check whether there are new files ...
-1
votes
0answers
16 views

How to run a function for a specific received packet? [duplicate]

I am doing an experiment for my master thesis. I want to run a function (e.g. multiply two numbers) when a specific packet is received (e.g. a packet with destination TCP port 6666). For example, I ...
3
votes
1answer
68 views

tmux script to launch several commands

How can I write the following in a bash script? tmux # Start tmux session. compass watch /path/to/project1/compass/ # Run the first process. Ctrl + B, " # Split the pane. compass watch /path/to/...
0
votes
2answers
61 views

How to add users from data in a text file

I am a beginner in linux. I have a question about creating multiple users in linux, but I need a program to work on it. There is a new users txt file, the content is following: adams:5000:Adams, John ...
0
votes
2answers
29 views

Passing variables to script [duplicate]

What is the difference between: ./script.sh "$VARIABLE" and ./script.sh ${VARIABLE} Is there any?
3
votes
2answers
68 views

Can you tell if a file has been renamed?

Many tools out there for syncing files aren't quite right for syncing you're home directory. Because of this, and to learn Ruby, I've been working on my own sync tool. An issue I've encountered, ...
0
votes
2answers
40 views

cat doesn't join my files when I run inside script

I'm doing a restore backups script, and when I try to join files which are splitted, cat prints that error: cat: fullbackup_mrbsNuevo_15_6_2016.tar.gz.*: No such file or directory The line that ...
1
vote
1answer
48 views

How to compress all files in folder and erase the untared versions via command line?

I have a backup disk containing uncompressed versions of my files that I would like to compress to save space on this disk. The disk (containing files to compress) is full (about 3TB with 17GB free). ...
0
votes
1answer
440 views

Echo semicolon in bash

I am trying to write to a file the following string: 1;2;3;4. The semicolons create problems. I have been able to figure out the following ecamotage to do it: variable='1;2;3;4' echo "${variable//;/\...
1
vote
1answer
495 views

Why is my loop not continuing properly in my rock paper scissors game?

I'm making a bo3 rock paper scissors game. So far I've gotten it to work under every condition except ties. When a tie happens, it's meant to 'remake' that game by just subtracting 1 from I. It doesn'...
0
votes
1answer
384 views

What's wrong with my elif statements in this rock paper scissors game I'm making [closed]

making a rock paper scissors game to learn better bash. For some reason it's not liking my elif statements and I can't figure out why. Also if there are any better ways of doing this let me know, ...
0
votes
0answers
27 views

Why is this udev remove rule not working? [duplicate]

Hate to ask this sort of question, but... Device info: udevadm monitor --env UDEV [3048.530438] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6.3 (usb) ACTION=remove BUSNUM=002 ...