Nov 22, 2001 #1 pd123 Programmer Joined May 22, 2001 Messages 48 Location GB In a shell script I have a variable con1 = "filename,table" I want to parse this string and split at the ',' to create 2 new variables for each value eg. Store 'filename' in a variable and 'table' in a variable Thanks.
In a shell script I have a variable con1 = "filename,table" I want to parse this string and split at the ',' to create 2 new variables for each value eg. Store 'filename' in a variable and 'table' in a variable Thanks.
Nov 22, 2001 #2 grega Programmer Joined Feb 2, 2000 Messages 932 Location GB One method would be ... VAR1=$(echo $CON1 | cut -d, -f1) VAR1=$(echo $CON1 | cut -d, -f2) Greg. Upvote 0 Downvote
Nov 22, 2001 #3 grega Programmer Joined Feb 2, 2000 Messages 932 Location GB One method would be ... VAR1=$(echo $CON1 | cut -d, -f1) VAR2=$(echo $CON1 | cut -d, -f2) Greg. Upvote 0 Downvote
Nov 22, 2001 #4 grega Programmer Joined Feb 2, 2000 Messages 932 Location GB .. ignore that 1st reply .. Greg. Upvote 0 Downvote
Nov 22, 2001 Thread starter #5 pd123 Programmer Joined May 22, 2001 Messages 48 Location GB I wasn't sure on the best place to post it. Thanks anyway. Upvote 0 Downvote