Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • Yes I'm actually using it like that a=hello and b=hi. that was a typing miss. There is no space and no $ while declaring variables. Please advice... Commented Jan 14, 2017 at 10:35
  • Well, the strings hello and hi are not equal. Also see unix.stackexchange.com/questions/72039/… Commented Jan 14, 2017 at 10:38
  • 2
    For the updated question: You will have to explain how you call this script and what you expect to happen. Commented Jan 14, 2017 at 11:05
  • I'm executing this script as ./test.sh followed by a server name for ex: ./test.sh hostname1 Commented Jan 14, 2017 at 11:16
  • I'm executing this script as ./test.sh followed by a server name for ex: ./test.sh hostname1 It should then lower the case and put it in variable 'S', and search for 'S' in the file Jump="/home/Lists/srv" if it finds there it should grep the first column and put it in another variable J1. Now, if value of 'S' and 'J1' are similar, then it should ssh to 'S' else (1st) it should first ssh to J1 and then ssh to S. Else (2nd) if it doesn;t find 'S' in Jump file it should directly ssh 'S'. While Im executing it directly goes to 1st else condition. even if S and J1 are similar Commented Jan 14, 2017 at 11:23