[comp.unix.questions] csh question -- SUMMARY

gjoost@westc.UUCP (Gertjan van Oosten) (09/22/89)

gjoost@westc.UUCP (Gertjan van Oosten) writes:

>The problem concerns csh-aliases (aliasi ??? - David Addison in
>'Moonlighting').
>The basic problem is as follows: I want an alias to kill all processes
>called 'roy'.
>...
>The problem comes down to having single quotes within single quotes.

Thanks for all the responses, I know now how to escape quotes.
(to wit: 'A 'B' C' meaning the quoted string A 'B' C should be written as
 'A '\''B'\'' C')
However, no matter how hard I tried, I couldn't find this in man 1 csh.
Oh well, I should have known the csh manual pages are incomplete
(understatement). :-(

One response I got via E-mail shall now be revealed to the world:

# From: Dan Bernstein <bernstei@hpuxa.ircc.ohio-state.edu>
# Subject: Re: csh question -- aliasing, quoting and the like
# Organization: Ohio State Univ IRCC
# 
# Perhaps you need my quote and makealias...
# 
#   a quote "/bin/sed 's/\\!/\\\\\!/g' | /bin/sed 's/'\\\''/'\\\'\\\\\\\'\\\''/g' | /bin/sed 's/^/'\''/' | /bin/sed 's/"\$"/'\''/'"
#   a makealias "quote | /bin/sed 's/^/alias \!:1 /' \!:2*"
# 
# (Note that the quote alias is a very long line.)
# 
# Basically, if you've just typed an amazing command that you want to save
# as an alias, type
# 
#   % makealias whateveraliasname >> .loginorwherever
# 
# and on the next line retype your command, return, ^D. At the end of
# .loginorwherever you'll have a command that, if sourced, will alias
# whateveraliasname to mean the command.
# 
# Try just typing makealias foo, then the rsh command just as you would
# type it interactively, then ^D, and see what makealias spits back at
# you.
# 
# ---Dan Bernstein, brnstnd@acf10.nyu.edu, bernstei@hpuxa.ircc.ohio-state.edu

This is quite useful, I think (YAU -- yet another understatement).
+----------------------------------------------------------------------+
| Gertjan van Oosten                                mcvax!westc!gjoost |
|                         West Consulting bv                           |
| Phoenixstraat 49          P.O. Box 3318           Tel: +31-15-123190 |
| 2611 AL  Delft            2601 DH  Delft          Fax: +31-15-147889 |
|                          The Netherlands                             |
+----------------------------------------------------------------------+
"No, you don't understand! WE SOW the seeds! NATURE GROWS the seeds! WE EAT
the seeds! And then: WE SOW the seeds! NATURE GROWS the seeds! ..."
- Neil in 'Sick' (The Young Ones)