•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 456,442 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,610 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 662 | Replies: 2
![]() |
•
•
Join Date: Feb 2006
Posts: 15
Reputation:
Rep Power: 3
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:
creation=`echo $backupid | sed 's/^.*_//'`
As always, thanks for the help!!
•
•
Join Date: Oct 2007
Posts: 306
Reputation:
Rep Power: 2
Solved Threads: 29
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!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
•
•
•
•
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?creation=`echo $backupid | sed 's/^.*_//'`
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".
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Active desktop recovery/Script error (Windows NT / 2000 / XP / 2003)
- 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 / 2003)
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



Linear Mode