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 Any help is appreciated on this. I've attached the code snippet below. As you felt, You can avoid Note: Why do you have? In this way the string is not empty. [: 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.
#! / 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 "
" bla "bla " is only two string concatenated (
" bla bla ").
":
\" 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
c प्रोग्रामिंग उदाहरण कोड
ReplyDeleteसी भाषा के बारे में अस्थायी फ़ाइल कोड बनाएँ