Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!brl-adm!seismo!mcvax!ukc!tcom!idec!kbsc!SouthBank!lawesn From: lawesn@SouthBank.UUCP Newsgroups: comp.unix.questions Subject: csh filename substitution Message-ID: <607@SouthBank.UUCP> Date: Fri, 6-Mar-87 12:22:05 EST Article-I.D.: SouthBan.607 Posted: Fri Mar 6 12:22:05 1987 Date-Received: Sun, 8-Mar-87 17:31:48 EST Organization: Milliways, The Restaurant at the end of the Universe Lines: 31 Apologies if this question has popped up in the past but... I was trying to rename a group of files from 'st.*' to '*' e.g. st.fred.dat => fred.dat st.jim.c => jim.c st.nick => nick I noticed that there was (according to the csh manual) an operator :s/l/r/ which was supposed to substitute 'r' for 'l' within the filename. So, I tried (amongst other things): foreach i (st.*) mv $i $i:s/st.// end This replies with a message 'Variable syntax' Could some kind soul out there please point out to me what I am doing wrong. I could achieve the correct result with sed, but would like to use this apparently nice feature (bug :-) in csh. Thanks. -- Nick Lawes -- +--------------------------------------------------------------------------+ | Nick Lawes (South Bank Polytechnic, UK) | ..mcvax!ukc!hrc63!kbsc!lawesn | +------------------------------------------+-------------------------------+