[comp.unix.wizards] quotation of metacharacters in csh

tomm@voodoo.UUCP (Tom Mackey) (05/07/87)

A friend of mine who is not on the net recently ran into a strange
situation that he (and I, too) would like some help on.  He frequently
brings over large numbers of files from a VMS system which have file
names followed with a semi-colon and a version number:

file1;001
file1;002
file1;003

Now there might also be other files as follows:

file1.dat
file1

When the cshell is used to "list all files starting with file1;", like so:

ls file1\;*

it returns "No Match".

Yet the same command under the Bourne shell works as expected.  What am I
missing?  How do you do the task using the cshell?

Thanks for any light you may shed on this mystery.

-- 
Tom Mackey                                (206) 342-1442 (wk)
Boeing Computer Services    ....uw-beaver!ssc-vax!voodoo!tomm
M/S 03-73,     P.O. Box 24346,     Seattle, WA     98124-0346

devine@vianet.UUCP (Bob Devine) (05/15/87)

In article <326@voodoo.UUCP>, tomm@voodoo.UUCP (Tom Mackey) writes:
> When the cshell is used to "list all files starting with file1;", like so:
> 
> ls file1\;*
> it returns "No Match".
> 
> Yet the same command under the Bourne shell works as expected.  What am I
> missing?  How do you do the task using the cshell?

Hi Tom,

  Here is a way to get around the interpretation of ';' by Csh:

	% ls file1`echo ';'`*	# not as elegant as Bourne/Korn shell

Bob

devine@vianet.UUCP (Bob Devine) (05/19/87)

> 	% ls file1`echo ';'`*	# not as elegant as Bourne/Korn shell

  After thinking a bit more, a better way to do it is:

	% set S = ';'
	% ls file1$S*	# works because the '*' stops interpretation of $S

Bob

awhite%mycroft@adm.UUCP (05/21/87)

	How about:
		ls "file1;"*

		?


------------------------------------------------------------
	  Arden White o Gould CSD o Urbana, IL
awhite@gswd-vms.arpa		ihnp4!uiucdcs!ccvaxa!awhite
------------------------------------------------------------

brian@scgvaxd.UUCP (05/22/87)

In article <326@voodoo.UUCP> tomm@voodoo.UUCP (Tom Mackey) writes:
>When the cshell is used to "list all files starting with file1;", like so:
>
>ls file1\;*
>
>it returns "No Match".

Um, what version of Unix/csh are you running?  On 4.[23]bsd systems at least,
this works just fine.  So does

ls file1';'*

and

ls file1";"*

						--Brian

{seismo,allegra,ihnp4}!scgvaxd!brian