<?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: Troubles with cshell in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984052#M99916</link>
    <description>I doubt.&lt;BR /&gt;&lt;BR /&gt;The script doesn't even get there. For some reason "if" returns true.</description>
    <pubDate>Thu, 08 Jun 2006 15:48:46 GMT</pubDate>
    <dc:creator>Alex Lavrov.</dc:creator>
    <dc:date>2006-06-08T15:48:46Z</dc:date>
    <item>
      <title>Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984048#M99912</link>
      <description>Hello all,&lt;BR /&gt;&lt;BR /&gt;well, for the first time in my life I'm forced to work with cshell and have some problems.&lt;BR /&gt;&lt;BR /&gt;This is my code:&lt;BR /&gt;&lt;BR /&gt;if ("$field_1" =~ ^[a-z]) then&lt;BR /&gt;echo "$field_1 IS OK" &lt;BR /&gt;else&lt;BR /&gt;echo "$field_1 NOT OK!!!" &lt;BR /&gt;endif&lt;BR /&gt;&lt;BR /&gt;As I understand it, it matches the strings that begin with a small letters. But ...&lt;BR /&gt;As output for "2F2" and "field_1" I get:&lt;BR /&gt;2F2 IS OK&lt;BR /&gt;&lt;BR /&gt;Any ideas what might be the problem?&lt;BR /&gt;&lt;BR /&gt;Thanx :)</description>
      <pubDate>Thu, 08 Jun 2006 14:44:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984048#M99912</guid>
      <dc:creator>Alex Lavrov.</dc:creator>
      <dc:date>2006-06-08T14:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984049#M99913</link>
      <description>Can I sell you a bushel of bash instead?</description>
      <pubDate>Thu, 08 Jun 2006 15:04:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984049#M99913</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2006-06-08T15:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984050#M99914</link>
      <description>Oh, believe me, I wan't and can do it with bash ....&lt;BR /&gt;&lt;BR /&gt;But it must be done with cshell and the worst part is it must run on Sun OS 5.9 ...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;:-)</description>
      <pubDate>Thu, 08 Jun 2006 15:41:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984050#M99914</guid>
      <dc:creator>Alex Lavrov.</dc:creator>
      <dc:date>2006-06-08T15:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984051#M99915</link>
      <description>I don't know csh either. I'm sure if you wait, you'll get an answer from someone who does.&lt;BR /&gt;&lt;BR /&gt;But in the mean time I played with it a little. I wonder if the "!" characters in the echo statement are goofing it up? Try removing them. Just a hunch.</description>
      <pubDate>Thu, 08 Jun 2006 15:43:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984051#M99915</guid>
      <dc:creator>John Kittel</dc:creator>
      <dc:date>2006-06-08T15:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984052#M99916</link>
      <description>I doubt.&lt;BR /&gt;&lt;BR /&gt;The script doesn't even get there. For some reason "if" returns true.</description>
      <pubDate>Thu, 08 Jun 2006 15:48:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984052#M99916</guid>
      <dc:creator>Alex Lavrov.</dc:creator>
      <dc:date>2006-06-08T15:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984053#M99917</link>
      <description>I'll check some slowaris c-hell scipts first thing tomorrow morning. Let you know if I can find a clue :-)&lt;BR /&gt;&lt;BR /&gt;Good to see you back in the ITRC Alex! How is the study?</description>
      <pubDate>Thu, 08 Jun 2006 15:54:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984053#M99917</guid>
      <dc:creator>Robert-Jan Goossens_1</dc:creator>
      <dc:date>2006-06-08T15:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984054#M99918</link>
      <description>#!/usr/bin/csh -c /usr/local/bin/bash</description>
      <pubDate>Thu, 08 Jun 2006 15:54:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984054#M99918</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2006-06-08T15:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984055#M99919</link>
      <description>Uh, sorry. Hope you don't mind another suggestion...&lt;BR /&gt;&lt;BR /&gt;Your example works for me when I change expression in if statement, like this:&lt;BR /&gt;&lt;BR /&gt;if ("$field_1" =~ [a-z]* ) then&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Jun 2006 15:55:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984055#M99919</guid>
      <dc:creator>John Kittel</dc:creator>
      <dc:date>2006-06-08T15:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984056#M99920</link>
      <description>Robert:&lt;BR /&gt;&lt;BR /&gt;Well, studies are pretty hard ... As you can see they are torchering me with csh on Sun OS ... And after that I have to write silly game in assembler for PDP11 (think it's grandpa of VAX). Beside that it's OK, but can't say I'm having fun, tho :)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;John:&lt;BR /&gt;&lt;BR /&gt;I got "0: Event not found." &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Jun 2006 16:02:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984056#M99920</guid>
      <dc:creator>Alex Lavrov.</dc:creator>
      <dc:date>2006-06-08T16:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984057#M99921</link>
      <description>Yes, that is caused by the !s. Remove them and then ( in conjunction with the modified expression ) it may work.&lt;BR /&gt;&lt;BR /&gt;From the HP-UX 11.11 man page:&lt;BR /&gt;&lt;BR /&gt;In an international environment, character ordering is determined by the setting of LC_COLLATE, rather than by the binary ordering of character values in the machine collating sequence.  This brings with it certain attendant dangers, particularly when using range expressions in file name generation patterns.  For example, the command,&lt;BR /&gt;&lt;BR /&gt;           rm [a-z]*&lt;BR /&gt;&lt;BR /&gt;might be expected to match all file names beginning with a lowercase alphabetic character.  However, if dictionary ordering is specified by LC_COLLATE, it would also match file names beginning with an uppercase character (as well as those beginning with accented letters). Conversely, it would fail to match letters collated after z in languages such as Norwegian.&lt;BR /&gt;&lt;BR /&gt;The correct (and safe) way to match specific character classes in an international environment is to use a pattern of the form:&lt;BR /&gt;&lt;BR /&gt;           rm [[:lower:]]*&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Jun 2006 16:06:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984057#M99921</guid>
      <dc:creator>John Kittel</dc:creator>
      <dc:date>2006-06-08T16:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984058#M99922</link>
      <description>Well, I removed !s, still no good ...&lt;BR /&gt;LC_COLLATE is not even set. The system is pure english.&lt;BR /&gt;&lt;BR /&gt;set field_1 = "2F2"&lt;BR /&gt;&lt;BR /&gt;if ("$field_1" =~ ^[a-z]) then&lt;BR /&gt;echo "$field_1 IS OK"&lt;BR /&gt;endif&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Output:&lt;BR /&gt;2F2 IS OK</description>
      <pubDate>Thu, 08 Jun 2006 16:09:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984058#M99922</guid>
      <dc:creator>Alex Lavrov.</dc:creator>
      <dc:date>2006-06-08T16:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984059#M99923</link>
      <description>remove !s AND ALSO fix expression...</description>
      <pubDate>Thu, 08 Jun 2006 16:11:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984059#M99923</guid>
      <dc:creator>John Kittel</dc:creator>
      <dc:date>2006-06-08T16:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984060#M99924</link>
      <description>Nope, tried all variations.&lt;BR /&gt;&lt;BR /&gt;This line works fine:&lt;BR /&gt;&lt;BR /&gt;if (`echo "$field_1" | grep '^[A-Za-z]' | wc -l`)&lt;BR /&gt;&lt;BR /&gt;but with "=~" it doesn't ... I think I miss something in if.</description>
      <pubDate>Thu, 08 Jun 2006 16:25:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984060#M99924</guid>
      <dc:creator>Alex Lavrov.</dc:creator>
      <dc:date>2006-06-08T16:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984061#M99925</link>
      <description>ok, sorry, I promise this will be my last post on this. I tried it the way you first presented it and had the same problem as you indicated. Now, with modifications I indicated, it works for me, with HP-UX csh, as following example shows. &lt;BR /&gt;&lt;BR /&gt;# cat tc1.sh&lt;BR /&gt;#!/usr/bin/csh&lt;BR /&gt;setenv field_1 $1&lt;BR /&gt;echo "1 = $1, field_1 = $field_1"&lt;BR /&gt;if ("$field_1" =~ [a-z]* ) then&lt;BR /&gt;  echo "$field_1 IS OK" &lt;BR /&gt;else&lt;BR /&gt;  echo "$field_1 NOT OK" &lt;BR /&gt;endif&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;# ./tc1.sh 2F2&lt;BR /&gt;1 = 2F2, field_1 = 2F2&lt;BR /&gt;2F2 NOT OK&lt;BR /&gt;&lt;BR /&gt;# ./tc1.sh hello&lt;BR /&gt;1 = hello, field_1 = hello&lt;BR /&gt;hello IS OK&lt;BR /&gt;&lt;BR /&gt;# ./tc1.sh Hello&lt;BR /&gt;1 = Hello, field_1 = Hello&lt;BR /&gt;Hello NOT OK    &lt;BR /&gt;</description>
      <pubDate>Thu, 08 Jun 2006 16:29:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984061#M99925</guid>
      <dc:creator>John Kittel</dc:creator>
      <dc:date>2006-06-08T16:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984062#M99926</link>
      <description>I didnot go to sleep.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/csh&lt;BR /&gt;setenv field_1 $1&lt;BR /&gt;echo "1 = $1, field_1 = $field_1"&lt;BR /&gt;if ("$field_1" =~ [a-z]* ) then&lt;BR /&gt;echo "$field_1 IS OK"&lt;BR /&gt;else&lt;BR /&gt;echo "$field_1 NOT OK"&lt;BR /&gt;endif&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;This script tests out okay on Linux c-shell.&lt;BR /&gt;&lt;BR /&gt;I think the suggestion from the previous post will also work on sun.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 08 Jun 2006 16:58:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984062#M99926</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2006-06-08T16:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984063#M99927</link>
      <description>Thanx, I'll try to make it work.&lt;BR /&gt;&lt;BR /&gt;The final regex, should match words that star with a-z or A-Z and after that contains only numbers and letters.&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Jun 2006 17:06:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984063#M99927</guid>
      <dc:creator>Alex Lavrov.</dc:creator>
      <dc:date>2006-06-08T17:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984064#M99928</link>
      <description>Apart from the &lt;BR /&gt;  echo "!!!"&lt;BR /&gt;being affect by history substitution and the leading "^" not matching front of string like bash, csh has a problem with locale.  If you use a locale like LANG=en_US.iso88591 then the [a-z] range will include aBbCcDd...Zz because the collation order doesn't group the lowercase characters together.  I don't know of any locale that would make [a-z] match 2.&lt;BR /&gt;The csh manual suggests using [[:lower:]] for a locale independent way to match lower case in file name patterns.  That does work for file names.  It doesn't work for =~.</description>
      <pubDate>Thu, 08 Jun 2006 17:16:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984064#M99928</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2006-06-08T17:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984065#M99929</link>
      <description>Oh I see ...  so "^" doesn't work as it should normally work, that solves one mystery ...&lt;BR /&gt;&lt;BR /&gt;And now I just need something after [A-Za-z] at the begining of the word, that will match any letter or number, like:&lt;BR /&gt;Alex342&lt;BR /&gt;aL3Lssd342&lt;BR /&gt;&lt;BR /&gt;But not:&lt;BR /&gt;aL34_234       &lt;BR /&gt;a324 234       &lt;BR /&gt;etc.&lt;BR /&gt;&lt;BR /&gt;I just can't make some stuff I found working in cshell ..&lt;BR /&gt;&lt;BR /&gt;Thanx in advance.</description>
      <pubDate>Thu, 08 Jun 2006 17:20:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984065#M99929</guid>
      <dc:creator>Alex Lavrov.</dc:creator>
      <dc:date>2006-06-08T17:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984066#M99930</link>
      <description>If you happened to have a typo that spelled "than" instead of "then", csh would presume that "than" was some executable name.  The if would determine whether to execute "than".  It would unconditionally execute the echo line.  It would silently pass by the unexpected endif line.&lt;BR /&gt;&lt;BR /&gt;if ( "$field_1" =~ [a-z]* ) than&lt;BR /&gt;echo "$field_1 IS OK"&lt;BR /&gt;endif&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Jun 2006 17:25:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984066#M99930</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2006-06-08T17:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with cshell</title>
      <link>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984067#M99931</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;perhaps it is better to use a switch/case construct, which uses filename matching patterns:&lt;BR /&gt;&lt;BR /&gt;switch ($field_1)&lt;BR /&gt;case [a-z]*:&lt;BR /&gt;    echo starting lower case&lt;BR /&gt;    breaksw&lt;BR /&gt;case [A-Z]*:&lt;BR /&gt;    echo starting upper case&lt;BR /&gt;    breaksw&lt;BR /&gt;default:&lt;BR /&gt;    echo starting not with a letter&lt;BR /&gt;endsw&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Fri, 09 Jun 2006 03:55:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/troubles-with-cshell/m-p/4984067#M99931</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-06-09T03:55:19Z</dc:date>
    </item>
  </channel>
</rss>

