second try at posting, hope I get this one correct.
#  REMOVE everything above this line
#
#
# shell script to test sed
#
#  I called this file x
#  the command I use to run it is    sh x
#  bash is my default sh
#
#-rwxr-xr-x   1 root     bin        279352 Mar 31  1997 /bin/bash*
#
#  this was written on Slackware 3.4, kernel 2.0.30
#
#  Red Hat 5.0  kernel 2.0.32 reacts exactly the same.
#
#  This will run 100% on Slackware 3.1, kernel 2.0.0
#  also on other unix systems I normally use (Coherent, Fortune, Convergent)
#
#################################################
#################################################
#################################################

# first problem
# multiple writes to same output file, zero file each time

echo "1
1
1
1
1
1
1
1
1
1
" | sed '

/^1/w foo.out1
/^1/w foo.out2
/^1/w foo.out2
'

#foo.out1 should hold 10 lines of data
#foo.out2 should hold 20 lines of data
#       (it will mirror out1, this is wrong)

#################################################
#################################################
#################################################

# Second problem
# multiple writes to same output file are treated like multiple open files.


echo "1
1
1
1
1
1
1
1
1
1
" | sed '

/^1/w foo.out1.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
/^1/w foo.out2.
'

# sed won't even run this ERROR MSG IS:
# sed: Hopelessely evil compiled in limit on number of open files.
#         re-compile sed



##################################################

#  Remove everything below this line

Reply via email to