csh question (and ksh port maybe)
Kevin E. Minor +1 708 632 7043
minor at motcid.UUCP
Fri Nov 9 02:27:29 AEST 1990
calvin at sequent.sequent.com (Calvin Goodrich) writes:
|>can any of you unix.gods tell me what :e :h :t :r :q :x :gh :gt :gr
|>stand for in csh? i've seen these used before but couldn't figure them out.
|>for the rtfm'ers in the crowd: yes, i read the man pages on csh but couldn't
|>get an informative answer.
OK this is out of my little UNIX pocket handbook back when I was at school
so if it's out of date or something... Sorry.
Argument modifiers (follow argument selectors):
:h Leave only the head of a pathname.
:r Remove the extension of a pathname, leaving the root.
:e Leave only the extension part of a pathname.
:t Leave the tail of a pathname, removing leading components.
(My favorite since I use it in my prompt - i.e. $cwd:t)
:g[shret&] Repeat action of modifier globally.
:q Quote substituted words to prevent further substitution.
:x Like (q), but break into words at blanks, tabs, newlines.
And here are the remainder modifiers - even though you didn't ask for them.
:s/<l>/<r>/ Substitute string <r> for string <l>.
:& Repeat previous expression.
:p Print but do not execute.
|>next question: do these things have an equivalent in ksh? apparently ksh
|>doesn't have these little buggers. if they're useful i want to be able to
|>use them in my favorite (imho, anyway) shell.
Do know, I try to stay away from ksh... (Just my preference...)
|>first person to give me a good answer to both questions gets a free cup of
|>coffee at my company's cafeteria. :]
Will ya fly me in too ???? :-)
Kevin
--
/-------------------------------------------------------\
| Kevin Minor ...uunet!motcid!minor |
\-------------------------------------------------------/
More information about the Comp.unix.shell
mailing list