| | |
Error in script
Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Feb 2006
Posts: 17
Reputation:
Solved Threads: 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:
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!!
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:
Shell Scripting Syntax (Toggle Plain Text)
creation=`echo $backupid | sed 's/^.*_//'`
As always, thanks for the help!!
•
•
Join Date: Oct 2007
Posts: 399
Reputation:
Solved Threads: 47
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
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
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
•
•
•
•
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:
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?Shell Scripting Syntax (Toggle Plain Text)
creation=`echo $backupid | sed 's/^.*_//'`
As always, thanks for the help!!
Shell Scripting Syntax (Toggle Plain Text)
creation=`echo "${backupid}" | sed 's/^.*_//'`
Edit: Since you're using ksh, you may also wish to change "echo" to "print".
Last edited by masijade; Nov 1st, 2007 at 9:12 pm.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
![]() |
Similar Threads
- Active desktop recovery/Script error (Windows NT / 2000 / XP)
- javascript - object required error (JavaScript / DHTML / AJAX)
- php undefined offset error (PHP)
- error 406 will pay to fix (Software Development Job Offers)
- help with shell script padding files with spaces (Shell Scripting)
- Regular expression (Perl)
- a weird Javascript error (JavaScript / DHTML / AJAX)
- "error has occured in script on this page" (Windows NT / 2000 / XP)
Other Threads in the Shell Scripting Forum
- Previous Thread: stumped need a start
- Next Thread: How to access parameters from another method in the same script
Views: 951 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for Shell Scripting






