This script is supposed to ssh to the server, which it does and then it supposed to say "case is correct" on the name of the server that the person entered if the case is correct (upper or lowercase). However, it works except that it never returns a servername. I just get "case is correct" and that's it. I have tried exporting variables, using "do export" in the script. Nothing works. Anyone have any clues? If I type in harvey when it asks "please type in the server" it should return harvey if the case is correct. Instead it returns "case is correct" and that's all.
echo -e "Please type the server: \c ":
read servername
for server in $servername; do ssh -t $server 'for filername in `cd /usr/openv/netbackup/db/images; 'ls'`; do if '[ -d /usr/openv/netbackup/db/images/$filername ]'; then echo -e "case is correct non $servername"; break; else echo "case incorrect"; break;fi done';done
Ashley1966
0
Newbie Poster
Recommended Answers
Jump to Postthe first for loop is useless.
your script is as messy as your post.
once you're on the server side, you can't go back to the client and again back to the server.
the "script" is sent and executed on the server.don't use
ls
inside scripts, the shell has …
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.