<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: help in goto (csh) in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709167#M100069</link>
    <description>You don't other to identify your OS version but PHCO_34714 addresses your problem. However, the csh man page clearly states "the shell rewinds the input as much as possible and searches for a line of the form label:". It gets more complicated if the shell's input file is not a seekable file (ie being read from a pipe) then the backward seeks are limited to the size of csh internal buffer. In this case, the man page clearly states "To the extent that this allows (ie the internal buffer), backeward gotos succeed on non-seekable inputs.&lt;BR /&gt;&lt;BR /&gt;I would think a better use of your time would be creating a translator for converting your existing scripts into something like Perl.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In any event, you are an accident waiting to happen. Your time</description>
    <pubDate>Wed, 21 Jun 2006 10:59:51 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2006-06-21T10:59:51Z</dc:date>
    <item>
      <title>help in goto (csh)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709159#M100061</link>
      <description>I'm porting some scripts from DCL(VMS) to csh, and need some help.&lt;BR /&gt;&lt;BR /&gt;A script with "goto" doesn't work the way I expect.&lt;BR /&gt;&lt;BR /&gt;-------------------------------------------&lt;BR /&gt;#!/usr/bin/csh&lt;BR /&gt;echo inside script&lt;BR /&gt;&lt;BR /&gt;LabelA:&lt;BR /&gt;echo this is Label A&lt;BR /&gt;&lt;BR /&gt;# blah blah blah&lt;BR /&gt;# (lots of comments and scripts in between)&lt;BR /&gt;# blah blah blah&lt;BR /&gt;&lt;BR /&gt;echo jumping to Label A&lt;BR /&gt;goto LabelA&lt;BR /&gt;&lt;BR /&gt;exit&lt;BR /&gt;-------------------------------------------&lt;BR /&gt;&lt;BR /&gt;When the comments and scripts between "LabelA" and "goto" is less than 2KB, it seems to work fine.&lt;BR /&gt;But when it's over 3KB, script says it can't find the "LabelA".&lt;BR /&gt;Is there any limit to the size ? &lt;BR /&gt;And is there any way to work around ?&lt;BR /&gt;&lt;BR /&gt;Thanks &lt;BR /&gt;jitou&lt;BR /&gt;</description>
      <pubDate>Sat, 14 Jan 2006 03:32:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709159#M100061</guid>
      <dc:creator>jitou</dc:creator>
      <dc:date>2006-01-14T03:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: help in goto (csh)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709160#M100062</link>
      <description>Jitou,&lt;BR /&gt;I think the problem is that script langauages are basically sequential langauages.&lt;BR /&gt;&lt;BR /&gt;So a goto actually is a 'rollback your instructions until you find this label'.&lt;BR /&gt;In your case the buffer accesable for rollback seems to be between 2 and 3K.&lt;BR /&gt;&lt;BR /&gt;Can you try and have your command block in a nother file and execute that command block from ./command_file after your goto label.</description>
      <pubDate>Mon, 16 Jan 2006 04:21:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709160#M100062</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-01-16T04:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: help in goto (csh)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709161#M100063</link>
      <description>Jitou,&lt;BR /&gt;&lt;BR /&gt;I hate to be a wet blanket here, but why would you want to use a 'goto' in the first place? &lt;BR /&gt;&lt;BR /&gt;Whether in csh, or any scripting or programming language, use of the 'goto' statement is usually a sign of shoddy/lazy programming.  &lt;BR /&gt;&lt;BR /&gt;You may want to analyze the scripts you are porting and revise the logic so that you don't have to use goto's.  &lt;BR /&gt;&lt;BR /&gt;(you may also want to convert the scripts to posix shell or ksh).&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Mark</description>
      <pubDate>Mon, 16 Jan 2006 10:19:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709161#M100063</guid>
      <dc:creator>Mark Ellzey</dc:creator>
      <dc:date>2006-01-16T10:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: help in goto (csh)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709162#M100064</link>
      <description>Thank you, Peter, Mark.&lt;BR /&gt;&lt;BR /&gt;I know that "goto" isn't the best option.&lt;BR /&gt;But there are soooo many DCLs with "goto" that we have to port, and some people have poor knowledge of neither csh nor DCL.&lt;BR /&gt;&lt;BR /&gt;So this was the idea:&lt;BR /&gt;"Before restructuring spaghetti DCLs, why not port to csh and if anything goes wrong, let's take a look at that script."&lt;BR /&gt;&lt;BR /&gt;This is the reason I asked for a work around.&lt;BR /&gt;&lt;BR /&gt;And also, if I was to change the method above, I wanted to know the real reason why csh says someting weird.&lt;BR /&gt;&lt;BR /&gt;Thanks &lt;BR /&gt;jitou&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Jan 2006 10:42:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709162#M100064</guid>
      <dc:creator>jitou</dc:creator>
      <dc:date>2006-01-16T10:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: help in goto (csh)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709163#M100065</link>
      <description>Jitou,&lt;BR /&gt;&lt;BR /&gt;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:&lt;BR /&gt;&lt;BR /&gt;source ./comment.file&lt;BR /&gt;&lt;BR /&gt;For the scripts that run in between the Label/goto, you could, once again as Peter says, create separate script files and call them.&lt;BR /&gt;&lt;BR /&gt;As I'm not an expert in csh, I don't know if that will work or not.  Be worth a try though...&lt;BR /&gt;&lt;BR /&gt;(Ugh, hate csh!).&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Mark</description>
      <pubDate>Mon, 16 Jan 2006 12:22:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709163#M100065</guid>
      <dc:creator>Mark Ellzey</dc:creator>
      <dc:date>2006-01-16T12:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: help in goto (csh)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709164#M100066</link>
      <description>Sorry me for defeating your worldview, but I have the same problem on some ia64-hpux1123, while on others ia64-hpux1123 boxes I dont have this problem. Reason,I think, not in amount of comments, but in pathces or something like this - other words it is not a limitation of csh but software flaw. Also, I can recomend trying tcsh as the replacement, as it is said "tcsh is son of csh, it adds file name completion"</description>
      <pubDate>Wed, 21 Jun 2006 03:51:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709164#M100066</guid>
      <dc:creator>Maxim Yakimenko</dc:creator>
      <dc:date>2006-06-21T03:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: help in goto (csh)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709165#M100067</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;it is really not the amount of comments but the amount of data (&amp;gt;n KB). To strip comments is one method to reduce the amount of data.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;Perhaps you can overcome this 'goto' problem with it.&lt;BR /&gt;Look at&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://gatekeep.cs.utah.edu/hppd/hpux/Shells/tcsh-6.14.05/" target="_blank"&gt;http://gatekeep.cs.utah.edu/hppd/hpux/Shells/tcsh-6.14.05/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Wed, 21 Jun 2006 04:46:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709165#M100067</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-06-21T04:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: help in goto (csh)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709166#M100068</link>
      <description>What amount?&lt;BR /&gt;I run the same script on two different boxes&lt;BR /&gt;with the same OS, but different patch sets&lt;BR /&gt;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?</description>
      <pubDate>Wed, 21 Jun 2006 10:34:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709166#M100068</guid>
      <dc:creator>Maxim Yakimenko</dc:creator>
      <dc:date>2006-06-21T10:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: help in goto (csh)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709167#M100069</link>
      <description>You don't other to identify your OS version but PHCO_34714 addresses your problem. However, the csh man page clearly states "the shell rewinds the input as much as possible and searches for a line of the form label:". It gets more complicated if the shell's input file is not a seekable file (ie being read from a pipe) then the backward seeks are limited to the size of csh internal buffer. In this case, the man page clearly states "To the extent that this allows (ie the internal buffer), backeward gotos succeed on non-seekable inputs.&lt;BR /&gt;&lt;BR /&gt;I would think a better use of your time would be creating a translator for converting your existing scripts into something like Perl.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In any event, you are an accident waiting to happen. Your time</description>
      <pubDate>Wed, 21 Jun 2006 10:59:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-in-goto-csh/m-p/3709167#M100069</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-06-21T10:59:51Z</dc:date>
    </item>
  </channel>
</rss>

