The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 11-24-2008
Konerak Konerak is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 20

Code:
#!/bin/sh

var='today--RSS_URL=http://someurl'

x1=`echo $var | sed "s_\(.*\)--\(.*\)=\(.*\)_\1_"`
x2=`echo $var | sed "s_\(.*\)--\(.*\)=\(.*\)_\2_"`
x3=`echo $var | sed "s_\(.*\)--\(.*\)=\(.*\)_\3_"`

echo "Testing results: var($var) x1($x1) x2($x2) x3($x3)"

This script will set the variables as you wish. You can export them or modify them or do whatever you want with them then.