HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: csh script syntax error
Operating System - HP-UX
1834437
Members
2345
Online
110067
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2004 06:19 AM
02-27-2004 06:19 AM
I am having a bit of a problem with the "if"
expression syntax with this "csh" script ( 108 lines ).
To run as is results in "syntax error at line 76; else is not matched"
Sounds pretty self explanitory, but it still eludes me.
Thanks for any help,
Randy
expression syntax with this "csh" script ( 108 lines ).
To run as is results in "syntax error at line 76; else is not matched"
Sounds pretty self explanitory, but it still eludes me.
Thanks for any help,
Randy
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2004 06:28 AM
02-27-2004 06:28 AM
Solution
Let me take a shot at this the first if statement:
if ($CLEANOPT == "UA") then \
has an ending else on about line 59 I thin:
else if ($CLEANOPT == "KES") then
echo "Cleaning up KES ATTRLIB directory."
but then on line 76 you have another else without an "if".
No big deal but you have to clean up your logic a little. Maybe with an 'if' before the first 'if' mentioned above if you are trying to nest the if-else statement.
Good luck
if ($CLEANOPT == "UA") then \
has an ending else on about line 59 I thin:
else if ($CLEANOPT == "KES") then
echo "Cleaning up KES ATTRLIB directory."
but then on line 76 you have another else without an "if".
No big deal but you have to clean up your logic a little. Maybe with an 'if' before the first 'if' mentioned above if you are trying to nest the if-else statement.
Good luck
If it has wheels or a skirt, you can't afford it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2004 06:32 AM
02-27-2004 06:32 AM
Re: csh script syntax error
Hi Randy,
I observed couple of errors. For ex.,
if ($filelist != "") then
rm `ls ???ATR?? | grep -v ^K`
#endif # Take this out
else if ($CLEANOPT == "KES") then
echo "Cleaning up KES ATTRLIB directory."
In the above else would become unmatched as you closed your previous if.
set filelist = `ls ???CAT?? | grep -v ^K`
if ($filelist != "") then
rm `ls ???CAT?? | grep -v ^K`
endif
endif #<< this matches your above else.
else
goto banner
endif
I don't know the logic but you may have to adjust your endif's to fit to your logic.
-Sri
I observed couple of errors. For ex.,
if ($filelist != "") then
rm `ls ???ATR?? | grep -v ^K`
#endif # Take this out
else if ($CLEANOPT == "KES") then
echo "Cleaning up KES ATTRLIB directory."
In the above else would become unmatched as you closed your previous if.
set filelist = `ls ???CAT?? | grep -v ^K`
if ($filelist != "") then
rm `ls ???CAT?? | grep -v ^K`
endif
endif #<< this matches your above else.
else
goto banner
endif
I don't know the logic but you may have to adjust your endif's to fit to your logic.
-Sri
You may be disappointed if you fail, but you are doomed if you don't try
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2004 07:15 AM
02-27-2004 07:15 AM
Re: csh script syntax error
John/Sridhar,
Thank you both for your input, I will go
over it using your input ( disclaimer: not my script ). Points assigned. Have a great weekend!
Randy
Thank you both for your input, I will go
over it using your input ( disclaimer: not my script ). Points assigned. Have a great weekend!
Randy
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP