🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1750

Re: csh question (and ksh port maybe)

#1750
From: karl_kleinpaste
Date: Fri, 09 Nov 1990 21:10
37 lines
2247 bytes
calvin@sequent.sequent.com 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.

Um, RTFM.

A SunOS 4.1 csh(1) man page discusses exactly what these terms mean on
pages 5 and 9.  Same thing for Pyramid OSx 4.4c's csh(1) man page.
From the Pyr version:

(page 5)
     The `:' separating the event specification from the word
     designator can be omitted if the argument selector begins
     with a `|', `$', `*' `-' or `%'.  After the optional word
     designator can be placed a sequence of modifiers, each pre-
     ceded by a `:'.  The following modifiers are defined:

          h      Remove a trailing pathname component, leaving the head.
          r      Remove a trailing `.xxx' component, leaving the root name.
          e      Remove all but the extension `.xxx' part.
          s/l/r/ Substitute l for r
          t      Remove all leading pathname components, leaving the tail.
          &      Repeat the previous substitution.
          g      Apply the change globally, prefixing the above, e.g. `g&'.
          p      Print the new command but do not execute it.
          q      Quote the substituted words, preventing further substitutions.          x      Like q, but break into words at blanks, tabs and newlines.

(page 9)
     The modifiers `:h', `:t', `:r', `:q' and `:x' may be applied
     to the substitutions above as may `:gh', `:gt' and `:gr'.
     If braces `{' '}' appear in the command form then the modif-
     iers must appear within the braces.  The current implementa-
     tion allows only one `:' modifier on each `$' expansion.

--karl
Technical Details
Message-ID: <KARL.90Nov9161005@giza.cis.ohio-state.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!cis.ohio-state.edu!karl_kleinpaste
References: <45969@sequent.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!cis.ohio-state.edu!karl_kleinpaste
From: karl_kleinpaste@cis.ohio-state.edu
Newsgroups: comp.unix.shell
Subject: Re: csh question (and ksh port maybe)
Message-ID: <KARL.90Nov9161005@giza.cis.ohio-state.edu>
Date: 9 Nov 90 21:10:05 GMT
References: <45969@sequent.UUCP>
Sender: news@tut.cis.ohio-state.edu
Organization: Ohio State Computer Science
Lines: 37