🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.shell
3 messages
3 total messages Started by Erik E. Rantapaa Thu, 06 Sep 1990 03:03
Why does !!:gs/:/ / change only one colon?
#1075
Author: Erik E. Rantapaa
Date: Thu, 06 Sep 1990 03:03
18 lines
1051 bytes
I want to substitute all the colons in a command line to, say, spaces in
/bin/tcsh.  However,

      !!:gs/:/ /

only changes the first colon.  Is this a bug?  Does anyone know how to get
around this?  While I've got your attention, I should also ask if anyone
has a better way to do the following in tcsh:

     echo "set today = (`date`)" > /tmp/.date
     source -h /tmp/.date
     !set:s/:/ /:s/:/ /

(note the kludge because the global sub doesn't work) but without calling
sed or writing a C program.  
-- 
Erik Rantapaa
  rantapaa@cs.umn.edu
Re: Why does !!:gs/:/ / change only one colon?
#1084
Author: Gordon C. Galligher
Date: Thu, 06 Sep 1990 18:46
12 lines
894 bytes
In article <1990Sep6.030354.27810@cs.umn.edu> rantapaa@cs.umn.edu 
(Erik E. Rantapaa) writes:
>While I've got your attention, I should also ask if anyone
>has a better way to do the following in tcsh:
>
>     echo "set today = (`date`)" > /tmp/.date
>     source -h /tmp/.date
>     !set:s/:/ /:s/:/ /

Try:  set today = (`date | tr ':' ' '`)

		-- Gordon.
Inserting the date into a (t)csh array
#1100
Author: Fabrice Le Metayer
Date: Fri, 07 Sep 1990 01:17
26 lines
1252 bytes
rantapaa@cs.umn.edu (Erik E. Rantapaa) writes:

> While I've got your attention, I should also ask if anyone
> has a better way to do the following in tcsh:
>
>     echo "set today = (`date`)" > /tmp/.date
>     source -h /tmp/.date
>     !set:s/:/ /:s/:/ /

Try :

	% eval `date '+set today=(%a %h %d %H %M %S 19%y)'`
	% echo $today
	Thu Sep 06 18 13 08 1990

The only problem is that you don't get the "CDT" string before the year.
If you can live without it, your problem is solved.

Regards,

--
Fabrice
--
Fabrice  Le Metayer              DOMAIN : fabrice@sj.ate.slb.com
Schlumberger Technologies - ATE  UUCP   : {amdahl,decwrl,uunet}!sjsca4!fabrice
San Jose, CA  95110              BELL   : (408) 437-5114
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads