Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/script/map

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/sh
#	map f:		takes a list of items on stdin, and applies the given
#			transformation to each of them.
case $# in
  1) ;;
  *) echo "$0: expected one cmdline argument" >&2
     exit 1 ;;
esac
transform=$1
read line
until [ -z "$line" ]
do
  $transform $line
  read line
done

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.