This does not work

some_func()
{
cat > /somefile/somewhere << EOF
fee fi fo fum
EOF
do_something_cool
}

# MAIN
(
while true
do
  some_func
) &


But ... this works

some_func()
{
do_something_cool
}

# MAIN
(
while true
do
cat > /somefile/somewhere << EOF
fee fi fo fum
EOF
some_func
) &


I need the whole bracket and & gimmick so SMF exit condition will
return correctly.  The problem is in the first way, the file
/somefile/somewhere will be written with zero byte, (and probably not
closed, I havent checked.)

The second way, the file is written correctly.  Probably something
with passing an EOF from inside a function to another function
enclosed by ()?  Anyhow, weird, interesting, and a mystery to me.

CT

Reply via email to