logo
down
shadow

I want to use parallel-ssh to run a bash script on multiple servers, but it simple prints the echo statements


I want to use parallel-ssh to run a bash script on multiple servers, but it simple prints the echo statements

By : RodrigoK
Date : November 22 2020, 10:56 AM
around this issue Have you also tried to use pssh with a simple bash-script so see if the communication is set up ok?
code :
$ pssh -h hosts.txt -A -l ben -P -I<./uptime.sh
Warning: do not enter your password if anyone else has superuser
privileges or access to your account.
Password: 
10.0.0.67:  11:06:50 up 28 min,  2 users,  load average: 0.00, 0.00, 0.00
[1] 11:06:50 [SUCCESS] 10.0.0.67
10.0.0.218:  11:06:50 up 24 min,  2 users,  load average: 0.00, 0.05, 0.20
[2] 11:06:50 [SUCCESS] 10.0.0.218


Share : facebook icon twitter icon
very simple OSX bash script: echo gives no output

very simple OSX bash script: echo gives no output


By : SeungWon Lee
Date : March 29 2020, 07:55 AM
This might help you It could be that you used an editor that defaults to \r as line separator, which was the separator used under classic (pre OS X) MacOS. Try wc -l hi.sh; if you get 0 lines, then it's a line ending problem. Your script would then be just a single comment line, which would of course do nothing.
Run bash with see the prints made by echo in script

Run bash with see the prints made by echo in script


By : Naresh Sharma Naraya
Date : March 29 2020, 07:55 AM
This might help you I got one script and I am designning a new one and the given script will be used and be called. , just run this,
code :
yourscript.sh > /dev/null
Bash echo prints gibberish if I trying to interpolate variable that is result of script call

Bash echo prints gibberish if I trying to interpolate variable that is result of script call


By : user3613746
Date : March 29 2020, 07:55 AM
this will help The construction of your string is leaving a carriage return character in it, so that the content is:
code :
scale=1; 54.334689<cr> / 2
scale=1; 54.334689<cr>
 / 2
s/ 2e=1; 54.334689
durat=$(ffprobe -v error -show_format $1 | tr -d '\r' | awk -F= '/duration/{print $NF}')
ffprobe -v error -show_format yourInputFile | grep duration | od -xcb
bash script does not display $strings in echo statements

bash script does not display $strings in echo statements


By : Dusan Zelenovic
Date : March 29 2020, 07:55 AM
wish of those help You say that you are in a Linux course covering bash. As such, I will share some general observations that I hope will help you generally:
Testing and Debugging
code :
#!/bin/bash

echo "Enter the first string"
read str1
echo "Enter the second string"
read str2

echo "This is the first string: ${str1}"
echo "This is the second string: ${str2}"

myLen1=${#str1}
myLen2=${#str2}

if [ -n "$str1" ]; then
    echo "Length of the first string is: ${myLen1}"
else 
    echo "Please enter a value for the first string with more than 0 characters"
fi

if [ -n "$str2" ]; then
    echo "Length of the second string is: ${myLen2}"
else 
    echo "Please enter a value for the second string with more than 0 characters"
fi
Writing a simple backup script in bash and sending echo output to email

Writing a simple backup script in bash and sending echo output to email


By : user3894048
Date : March 29 2020, 07:55 AM
wish helps you Your code is all messed up in the post, but anyway... you should probably compare the output of 'stat -c %Y' (not %y) to the output of 'date +%s' (not %d).
But, even better, use something like md5sum or sha1sum to make sure the backed up file really matches the original.
Related Posts Related Posts :
  • how to replace a string at a specific position in a csv file using bash
  • how to delete duplicate lines in a text file in unix bash?
  • Compare a variables in bash
  • How do I use sed on a string?
  • Using bash variables for range in sed
  • convert a DURATION HH:MM:SS to seconds in bash
  • Shell make system paths click-able when printed out by my shell script
  • AWK between 2 patterns - first occurence
  • Nginx on docker - daemonize and attach to bash
  • Delete or Replace nth line in a file after a pattern match using shell scripts
  • Actual return code for SCP
  • How to exit a bash function that expects a return
  • Bash script to split file into two files while changing output file during processing
  • Pass command line arguments via sbatch
  • variable substitution (what do you call/name this method)?
  • Call function from another shell script
  • How to Grep and Replace With Exclusions
  • shell command to remove characters after a special character in bash/shell
  • How do I run a script for 1st working day of every month in cron?
  • Bash Unexpected End of File Error After Installing RVM
  • Nested Loop with increment on inner loop?
  • video orientation detection in bash
  • Interrupt sleep in bash with a signal trap
  • Want file rename script to add number at end with fixed length
  • What's the DRYest way to replace a file with a symlink in bash
  • How to run Bitcoin's autogen.sh file?
  • Renaming files in folder and subfolders using a list- Bash Script/Unix
  • Bash command to compare more than two files
  • If It is a directory append text
  • What's wrong with my WHILE-DO loop, or why my script can't find the file I'm giving it on a plate?
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org