Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: fpm@zk3.dec.com (Finnbarr P. Murphy)
Subject: Re: sh script
Date: 1998/11/11	[thread overview]
Message-ID: <72cnob$7v8$1@nntpd.lkg.dec.com> (raw)
In-Reply-To: 36406956.3F54@g24ux.phys.uniroma1.it


Try

  #! /usr/bin/posix/sh
  rand=`expr 1` 
  /bin/ps -e -o pid | while read mypid
  do
	if [ "${mypid}" != "PID" ]; then
		rand=`expr \( "${rand}" + "${mypid}" \) % 100`
	fi
	echo "inside loop: rand=" ${rand}
  done
  echo "outside loop: rand=" ${rand}

or

  #! /usr/bin/ksh
  .....


Finnbarr



  parent reply	other threads:[~1998-11-11  5:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-04  5:00 sh script Daniele Fua
1998-11-04  5:00 ` Allan Hawdon
1998-11-04  5:00 ` Daniele Fua
1998-11-11  5:00 ` Finnbarr P. Murphy [this message]
1998-11-12  5:00 ` Robert Klima
2000-01-26  5:00 ` Loris Renggli
2000-01-26  5:00   ` Daniel S. Riley
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox