Plan 9 from Bell Labs’s /usr/web/sources/contrib/pac/rc/bin/walk

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


#!/bin/rc
# walk -- walk the directory tree
# authors: Steve Hemminger <sch@postman.ncube.com>, Peter A. Cejchan <pac@plan9.cz>
# usage: walk dir cmd
# e.g.: 
#	walk wrk 'pwd; grep -n special *.[ch] '
#	walk wrk 'pwd; ls -l '

rfork e
if (~ $#* 0) {
 echo 'usage: walk dir cmd ' >[1=2]
 exit usage
}
d=$1
shift
 cmd=$*
#for (f in `{du $d | awk '{print $2}'}) {
for (f in `{w $d}) {
        @{ cd $f; { eval $cmd >[2] /dev/null }}
}

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.