Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 (Denver Mods 7/26/84) 6/24/83; site drutx.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!drutx!gfs
From: gfs@drutx.UUCP (SkinnerGF)
Newsgroups: net.unix
Subject: why doesn't this shell program work
Message-ID: <2147@drutx.UUCP>
Date: Fri, 1-Mar-85 15:16:40 EST
Article-I.D.: drutx.2147
Posted: Fri Mar  1 15:16:40 1985
Date-Received: Sat, 2-Mar-85 04:48:06 EST
Organization: AT&T Information Systems Laboratories, Denver
Lines: 22

..........
Here is a very simple program to print out your directories


variable=none
echo "directories"
for filename
in `ls`
do
	if test -d $filename
	then	variable=some
		echo $filename
	fi
done | pr -t4
echo $variable


HOWEVER, variable will always be none wheather or not anything
was found!  further debugging shows that variable = some before
exiting the pipe but, variable = none after exiting the pipe.
Why does the pipe do this?
Thanks in advance    .....    gary skinner   drutx!gfs