🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.shell
3 messages
3 total messages Started by Hunter Scales Mon, 24 Sep 1990 15:18
how to make csh leave quotes on args
#1225
Author: Hunter Scales
Date: Mon, 24 Sep 1990 15:18
25 lines
837 bytes
	Does anyone know how to force csh to leave the quotes on args
	and pass them down to a command?

	I.e., I need to call a command like so:

	foo "this is an argument"

	from a shell.  I have tried this:

	set string = "this is an argument"
	foo "$string"

	and I get:

	foo this is an argument

	how can I force it leave the quotes on?



-- 
Motorola Semiconductor Inc.                Hunter Scales
Austin, Texas             {harvard,utah-cs,gatech}!cs.utexas.edu!oakhill!hunter
#include <disclaimer.h>
Re: how to make csh leave quotes on args
#1226
Author: karl_kleinpaste
Date: Mon, 24 Sep 1990 18:21
17 lines
1090 bytes
hunter@oakhill.uucp writes:
   Does anyone know how to force csh to leave the quotes on args
   and pass them down to a command?

You have to quote the quoting.  Either
	set string = '"this is an argument"'
where single-quotes preserve everything literally, or if you have a
grotesque fascination for backslashes,
	set string = \"this\ is\ an\ argument\"
where backslash forces the following character to be interpreted as an
ordinary character.

Double quotes preserve whitespace in a string and prevent globbing
(that is, wildcard matching of *?[]) but permit interpolation of
variables; single quotes cause no interpretation at all.

--karl
Re: how to make csh leave quotes on args
#1247
Author: Joe Smith
Date: Thu, 27 Sep 1990 01:02
18 lines
1230 bytes
In article <3883@cerberus.oakhill.UUCP> hunter@oakhill.UUCP (Hunter Scales) writes:
>	set string = "this is an argument"
>	foo "$string"
>does not produce the same thing as
>	foo "this is an argument"

	set string='"variable with double quote characters inside it"'
	foo "$string"
or
	set string="variable consisting of several words, no quotes"
	foo '"'"$string"'"'

Strings with different types of quotes can be concatinated together.
-- 
Joe Smith (408)922-6220 | SMTP: jms@tardis.tymnet.com or jms@gemini.tymnet.com
BT Tymnet Tech Services | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms
PO Box 49019, MS-C41    | BIX: smithjoe | 12 PDP-10s still running! "POPJ P,"
San Jose, CA 95161-9019 | humorous dislaimer: "My Amiga 3000 speaks for me."
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads