🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1612

Re: using set in a csh script

#1612
From: Michael Salmon
Date: Thu, 25 Oct 1990 07:33
19 lines
987 bytes
In article <21752@dime.cs.umass.edu> martha@cs.umass.edu (Martha S. DasSarma) writes:
>
>	I am trying to do set a variable that includes spaces, but the
>	set deletes them.
>	I type:
>
>	$ set t="Mon   5"
>	$ echo $t
>	$ Mon 5
>
>	What happens is that the set deletes the extra spaces I put 
>	in the set.
>	How could I preserve the spaces?

Set hasn't deleted the spaces, they were deleted in the parsing of echo, just as if
you typed $ echo Mon   5. Try $ echo "$t".

Regards
   Michael Salmon
Technical Details
Message-ID: <1990Oct25.073325.2331@ericsson.se>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!know!cs.utexas.edu!sun-barr!olivea!mintaka!bloom-beacon!eru!hagbard!sunic!ericom!eos.ericsson.se!epames
References: <21752@dime.cs.umass.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!know!cs.utexas.edu!sun-barr!olivea!mintaka!bloom-beacon!eru!hagbard!sunic!ericom!eos.ericsson.se!epames
From: epames@eos.ericsson.se (Michael Salmon)
Newsgroups: comp.unix.shell
Subject: Re: using set in a csh script
Message-ID: <1990Oct25.073325.2331@ericsson.se>
Date: 25 Oct 90 07:33:25 GMT
References: <21752@dime.cs.umass.edu>
Sender: news@ericsson.se
Reply-To: epames@eos.ericsson.se
Organization: Ericsson Telecom AB
Lines: 19