Hi,
We have a SunOS 5.10 Generic_142900-13 sun4v sparc SUNW,T5240.
I'm trying to find a way to split a string into 2 variables.
Ex:
parm1="192.168.1.101/parent/child"
What I need to do is split the string above into:
host="192.168.1.101"
location="parent/child"
I saw the solution provided here
https://www.unix.com/shell-programmin...tion-file.html but somehow we don't have the -o option for grep as I keep getting illegal option --o.
The purpose of this is for a shell script already created to do an FTP function. Originally it was intended for accepting HOST, USER, PASS and FILE parameters only. Basically file goes to whatever the main directory on FTP connect. Now users are passing HOST/folder as value for HOST parameter which gives out an error now since 192.168.1.101/parent/child is not a valid HOST. And it would be a lot of work to add another parameter for LOCATION because a lot of other programs are already using this script so I'm trying to avoid this solution for now.
I'd appreciate any suggestions.
Thanks.