Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 May 1997 15:39:03 +0200 (MET DST)
From:      Zahemszky Gabor <zgabor@CoDe.hu>
To:        freebsd-questions@freebsd.org (FreeBSD questions)
Cc:        un_x@anchorage.net
Subject:   Re: sed (multi-line)
Message-ID:  <199705201339.PAA00214@CoDe.hu>
In-Reply-To: <Pine.BSF.3.95q.970517200640.5775A-100000@aak.anchorage.net> from Steve Howe at "May 17, 97 08:12:04 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> is there any way to enter a sed commands that requires multiple
> lines on a command line?
> 
> c\
> XXX

Of course, yes: (for ease of use, use sh/bash/ksh/..., and not csh)
$ sed -e 'c\
> XXX' filename
$

Or:
$ sed -f /dev/tty filename
c\
XXX
^D
$

Another one:

$ sed -e "c\\
> XXX" filename
$

Bye, Gabor
--
#!/bin/ksh
Z='21N16I25C25E30, 40M30E33E25T15U!' ;IFS=' ABCDEFGHIJKLMNOPQRSTUVWXYZ ';set $Z;for i { [[ $i = ? ]]&&print $i&&break;[[ $i = ??? ]]&&j=$i&&i=${i%?};typeset -i40 i=8#$i;print -n ${i#???};[[ "$j" = ??? ]]&&print -n "${j#??} "&&j=;typeset +i i;};IFS=' 0123456789 ';set $Z;X=;for i { [[ $i = , ]]&&i=2;[[ $i = ?? ]]||typeset -l i;X="$X $i";typeset +l i;};print "$X"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705201339.PAA00214>