bash - Using sh -c if comparisons inside an SSH command -


There's a problem with i! = If statement section is basically this statement is valid, as far as I know it executes this [: 1:! =: Unexpected operator returns. I have tried to execute using the -n, but for any reason, if the output is empty, then -n still runs the echo command.

Any help is appreciated on this. I've attached the code snippet below.

  #! / Bin / sh HOST = $ 1 USER = "/ script / zone $ HOST | tr -d '\ r'" ssh -t $ HOST -p 22 -l deehem "sh -c 'if [" !! " "=" \ '$ USER \' "]; then" HOST $ $ HOST: \ '$ USER \ `Username"; Fi "; Bash -login "   

As you felt, " bla "bla " is only two string concatenated (" bla bla ").

You can avoid ": \" but in the standard [ test tool There is an option specifically for this task:

  -n STRING STRING is non -jojo-ja STRING's STRING's length is zero   

Note: Why do you have? In this way the string is not empty.

Comments

Post a Comment

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -