The Open Source Swiss Army Knife

/unix/unix_editors/sed/
/unix/unix_editors/sed/ + sub-categories
http://www.sirfsup.com/
web directory content
    
      

Not logged in
Chat Register Login
return to:  http:/www.sirfsup.com      /unix   /unix_editors   /sed 
sub-categories and articles

                                                  
dirapplication1 famous sedscr runsed.sh tool
dirinsert_recursive add
   --->create new sub-category


a3.sed
a multi-line example with redirection

(run from the commandline exactly as is here) sed \ -e 's#@NAME@#x11-ssh-askpass#g' \ -e 's#@VERSION@#1.2.4.1#g' \ -e 's#@DATE@#September 17, 2001#g' \

all_sed_oneliners.txt
add

------------------------------------------------------------------------- HANDY ONE-LINERS FOR SED (Unix stream editor) Apr. 26, 2004 compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.4 Latest version of this file is usually at: http://sed.sourceforge.net/sed1line.txt

convertlinux
ed substitutes into a file

/* http://vip.cs.utsa.edu/usp/ dr.robbins utsa computer science "unix systems programming" */ #!/bin/sh ed < convertlinux.ed

convertlinux.ed
ed substitutes into a file

/* http://vip.cs.utsa.edu/usp/ dr.robbins utsa computer science "unix systems programming" */ e makefile /COPS s/=/=-D_GNU_SOURCE w

ex_commands.txt
add

#!/bin/sh # from the O'Reilly vi book chapter 7 section 4 # on how to run an ex commands from a bash script # wont' need to open vi on all the files and repeat these substitutions # on each file anymore!!

iptables.txt
uses a character class and bash back-substitution

#!/bin/sh # # Startup script to implement /etc/sysconfig/iptables pre-defined rules. # # chkconfig: 2345 08 92

mult_subs.sed
use -e to use sed in succession on output and produce one pipelined result as output

# I don't know what -n does but with -ne there is no output produced from this bash function function cs () { location=`echo $2 | sed -e 's,/home/jspeigle,/home/joe,' -e 's,x,/var/sirfsup,'` echo $location }

pipe.txt
SIGNED_POL=`grep POLFILE $TXT_CFG | sed -e 's/^.*=(.*)//'`

# Name of clear text configuration file TXT_CFG=$CONF_PATH/twcfg.txt # Path of the final Tripwire policy file (signed) SIGNED_POL=`grep POLFILE $TXT_CFG | sed -e 's/^.*=\(.*\)/\1/'` where twcfg.txt is the following:

pipe2.txt
basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;

#!/bin/sh # call with --basedir=x --datadir=y --pid-file=z parse_arguments() { for arg do case "$arg" in

runsed.txt
shell script to run sed with expressions in file

#!/bin/sh for x do echo "editing $x: \c" if test "$x" = sedscr; then

sed1.txt
cat /home/joe/jon | sed -ne /ftp/p

cat /home/joe/jon | sed -ne /ftp/p

sed_var_asinmnt.txt
KERNTYPE=`sed -n 's_^/* Kernel type (.*) */__p' /boot/kernel.h 2>/dev/null`;

cat header.tk >> ./kconfig.tk ./tkparse < ../arch/i386/config.in >> kconfig.tk KERNTYPE=`sed -n 's_^/\* Kernel type \(.*\) \*/_\1_p' /boot/kernel.h 2>/dev/null`; \

transiliteration2.txt
add

NOT TRANSLITERATION, THE \U ADDS unicode down to it % Transliterations of wide equivalents. + % Generated through + % $ grep '^[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;[^;]*;' UnicodeData.txt | \ + % sed -e 's/^\([^;]*\);\([^;]*\);[^;]*;[^;]*;[^;]*; \([^;]*\);.*$/ % \2/'

transliteration.txt
add

y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/

webalizer.sed
add

#!/bin/sh # httpd.conf: <virtual host>... CustomLog /var/log/httpd/`virtual-host-name`-al # </virtual host> # cd /etc/webalizer; ls ====>>>> `virtual-host-name1.conf virtual-host-name2.conf ....... # this script invokes `webalizer` passing it each log file name which

webalizer2.sed
add

#!/bin/sh # httpd.conf: <virtual host>... CustomLog /var/log/httpd/`virtual-host-name`-al # </virtual host> # cd /etc/webalizer; ls ====>>>> `virtual-host-name1.conf virtual-host-name2.conf ....... # this script invokes the webalizer (a log analysis program) passing it each vurtual server's access
   --->upload your article


User submitted category site links


(None)

-->submit a page from your site dealing with sed to the sirfsup! web directory for listing

return to top