Hot answers tagged

4 votes

Doubts about cron on ubuntu

Some hints: cron does not open a terminal: it executes commands in the background. To execute sinprod daily at 6:50, open the crontab for editing: crontab -e However, since you need to run sinprod ...
  • 25.4k
2 votes
Accepted

Bash Script to check in terminal if URLS are up or down?

Ive tested it a couple of times, seems to work ok. #!/bin/bash if [ $# -eq 0 ] then fin=- else fin=$1 fi urlarr=( $(cat $fin | strings | tr ',:\/' '\n\n\n' | grep -i "\.com\|\.net\|\.edu\|\...
  • 139
2 votes

trying using a bash script in wsl with cd but it doesn't do anything

Your script, which you invoked with the command bash Desktop.sh worked perfectly, but you do not see any effect. Why? Because the script is run in a subshell. Executing the script with bash Desktop....
  • 70.8k
2 votes
Accepted

Passing filenames with spaces into linux functions using variables in bash script

Use an array, quoting elements where they contain spaces or other shell-special characters, like comm=(cmp "${a}" "${b}") then evaluate as "${comm[@]}" See for example ...
1 vote

Bash Script to check in terminal if URLS are up or down?

This is the best i can do without your urls to test. If the wget part doesnt work out you can look into replacing w/ curl or ncat (nc) to test wether streams are live. #!/bin/bash if [ $# -eq 0 ] ...
  • 139

Only top scored, non community-wiki answers of a minimum length are eligible