I'm trying to take the output of an environment that has multiple strings
ex.
# echo $SSH_CLIENT
192.168.1.1 57039 22
I need that IP... so I can set it to another environment.
Thank you
I'm trying to take the output of an environment that has multiple strings
ex.
# echo $SSH_CLIENT
192.168.1.1 57039 22
I need that IP... so I can set it to another environment.
Thank you
IP=${SSH_CLIENT%% *}
Thank you Franklin52.
Is there any way I could have a break down on why that works so I may better understand it?
Have a read of this:
Learning the Korn Shell, 2nd Edition: Chapter 4: Basic Shell Programming
Regards