- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- help in goto (csh)
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
тАО01-13-2006 07:32 PM
тАО01-13-2006 07:32 PM
help in goto (csh)
A script with "goto" doesn't work the way I expect.
-------------------------------------------
#!/usr/bin/csh
echo inside script
LabelA:
echo this is Label A
# blah blah blah
# (lots of comments and scripts in between)
# blah blah blah
echo jumping to Label A
goto LabelA
exit
-------------------------------------------
When the comments and scripts between "LabelA" and "goto" is less than 2KB, it seems to work fine.
But when it's over 3KB, script says it can't find the "LabelA".
Is there any limit to the size ?
And is there any way to work around ?
Thanks
jitou
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2006 08:21 PM
тАО01-15-2006 08:21 PM
Re: help in goto (csh)
I think the problem is that script langauages are basically sequential langauages.
So a goto actually is a 'rollback your instructions until you find this label'.
In your case the buffer accesable for rollback seems to be between 2 and 3K.
Can you try and have your command block in a nother file and execute that command block from ./command_file after your goto label.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2006 02:19 AM
тАО01-16-2006 02:19 AM
Re: help in goto (csh)
I hate to be a wet blanket here, but why would you want to use a 'goto' in the first place?
Whether in csh, or any scripting or programming language, use of the 'goto' statement is usually a sign of shoddy/lazy programming.
You may want to analyze the scripts you are porting and revise the logic so that you don't have to use goto's.
(you may also want to convert the scripts to posix shell or ksh).
Regards,
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2006 02:42 AM
тАО01-16-2006 02:42 AM
Re: help in goto (csh)
I know that "goto" isn't the best option.
But there are soooo many DCLs with "goto" that we have to port, and some people have poor knowledge of neither csh nor DCL.
So this was the idea:
"Before restructuring spaghetti DCLs, why not port to csh and if anything goes wrong, let's take a look at that script."
This is the reason I asked for a work around.
And also, if I was to change the method above, I wanted to know the real reason why csh says someting weird.
Thanks
jitou
- Tags:
- DCL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2006 04:22 AM
тАО01-16-2006 04:22 AM
Re: help in goto (csh)
Ok, I understand. You may then want to use Peter's solution of putting all the comments in a separate file and calling them from the script as:
source ./comment.file
For the scripts that run in between the Label/goto, you could, once again as Peter says, create separate script files and call them.
As I'm not an expert in csh, I don't know if that will work or not. Be worth a try though...
(Ugh, hate csh!).
Regards,
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-20-2006 08:51 PM
тАО06-20-2006 08:51 PM
Re: help in goto (csh)
- Tags:
- tcsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-20-2006 09:46 PM
тАО06-20-2006 09:46 PM
Re: help in goto (csh)
it is really not the amount of comments but the amount of data (>n KB). To strip comments is one method to reduce the amount of data.
I suggest to install the TCSH package - tcsh is highly compatible to csh but is not so 'fixed buffer programmed' like the old fashioned csh.
Perhaps you can overcome this 'goto' problem with it.
Look at
http://gatekeep.cs.utah.edu/hppd/hpux/Shells/tcsh-6.14.05/
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-21-2006 03:34 AM
тАО06-21-2006 03:34 AM
Re: help in goto (csh)
I run the same script on two different boxes
with the same OS, but different patch sets
and have this scripts successfuly completed on one and broken on another - why the SAME script on the SAME OS but different patches has different results?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-21-2006 03:59 AM
тАО06-21-2006 03:59 AM
Re: help in goto (csh)
I would think a better use of your time would be creating a translator for converting your existing scripts into something like Perl.
In any event, you are an accident waiting to happen. Your time