From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <32987a381a6dd9037ee880078b7f5b3d@plan9.escet.urjc.es> From: Fco.J.Ballesteros To: 9fans@cse.psu.edu Subject: Re: [9fans] walk In-Reply-To: <200307251359.h6PDx7704315@augusta.math.psu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Fri, 25 Jul 2003 16:07:28 +0200 Topicbox-Message-UUID: 03fabb12-eacc-11e9-9e20-41e7f4b1d025 there's also this single `walk' script that evaluates arbitrary expressions on files, like in ;; walk . '~ $f *.c && test -r $f && cp $f /tmp' its idea is simply to set $f to the file name and evaluate the command for each file found in the tree. Works fine enough so I didn't bother to replace it. #!/bin/rc rfork e if (~ $#* 0) { echo 'usage: walk file [cmd...]' >[1=2] exit usage } file=$1 shift if (~ $#* 0) cmd='echo $f' if not cmd=$* cd `{basename -d $file} exec du -a $file | awk '{print $2}' | while (f=`{read}) { eval $cmd }