Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sed: 0602-404 Function s:\(.*\)\(.\):\1,\2: 738 0 canno

Status
Not open for further replies.

Marcel1958

Technical User
Oct 11, 2001
38
NL
The following line gives the error:

print "$DATUM"" ""${GEMID01}" | sed -e 's:\(.*\)\(.\):\1,\2:'"$GEMID02"" ""$TELAANTAL"

The problem is "$GEMID02"" ""$TELAANTAL" whithout this it works oke
 
Sorry, i was very short.

I received the following message:
sed: 0602-404 Function s:\(.*\)\(.\):\1,\2: 738 0 cannot be parsed.

What i do is print the variable $DATUM Then
som spaces
folowed by
"${GEMID01}" | sed -e 's:\(.*\)\(.\):\1,\2:'

So the print command is:
print "$DATUM"" ""${GEMID01}" | sed -e 's:\(.*\)\(.\):\1,\2:'

So far so good.

Now i will print in the same line another variable too.

So the print command is:

print "$DATUM"" ""${GEMID01}" | sed -e 's:\(.*\)\(.\):\1,\2:'"$GEMID02"

Now is have the error message
 
Are you missing a closing / from the sed command

e.g.

print "$DATUM"" ""${GEMID01}" | sed -e 's:\(.*\)\(.\):\1,\2:/'"$GEMID02"

Not tried but just an idea.

Matt.

 
Also I think sed is trying to do something with the second variable. You've used a pipe from the first echo so it's not part of the print command.

You would need something like

var1=$(print "$DATUM"" ""${GEMID01}" | sed -e 's:\(.*\)\(.\):\1,\2:/')
print $var1$GEMID02

Matt.
 
not quite sure if this is what you want, but might be worth a go ...

Code:
print "$DATUM  $(echo ${GEMID01} | sed -e 's/\(.*\)\(.\)/\1,\2/')$GEMID02"

if you aren't using ksh ... you could use back-ticks:
Code:
print "$DATUM  `echo ${GEMID01} | sed -e 's/\(.*\)\(.\)/\1,\2/'`$GEMID02"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top