Path: 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: 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 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