0

Hello,

I have a script I've used on pre-Solaris 10 that works just great. Now on a Sol10 box, it is bailing on this line with this error: syntax error at line 27: `|' unexpected
Here's the 'offending' line:

creation=`echo $backupid | sed 's/^.*_//'`

I'm a bit confused as to why this isn't working as I've pulled it out of the script and can run it successfully from the command line directly. Any ideas?

As always, thanks for the help!!

3
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by masijade
0

Hey there,

From the info you've given I wrote this:

#!/bin/ksh

backupid="hi_there"
creation=`echo $backupid | sed 's/^.*_//'`
echo $creation

and ran it. It returned:

_there

Do you have more info on it? What would your backupid variable be set to? We're running Solaris 10 on hardware like V245's, T2000's and X4100's - also some Fujitsu PrimePowers. Also, it might be related to a patch. We're running the recommended patchset from April still.

Thanks,

, Mike

0

Hello,

I have a script I've used on pre-Solaris 10 that works just great. Now on a Sol10 box, it is bailing on this line with this error: syntax error at line 27: `|' unexpected
Here's the 'offending' line:

creation=`echo $backupid | sed 's/^.*_//'`

I'm a bit confused as to why this isn't working as I've pulled it out of the script and can run it successfully from the command line directly. Any ideas?

As always, thanks for the help!!

It shouldn't really make a difference, but the following change is always worth while, and worth a try:

creation=`echo "${backupid}" | sed 's/^.*_//'`

Edit: Since you're using ksh, you may also wish to change "echo" to "print".

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.