Friday, August 11, 2006

Shell script之練習

Objective: move *.conf files from /nfsdata to /tmp

# cd ~
# cd bin/
# vi movefiles.sh
#!/bin/bash
for VAR in `find /nfsdata -iname "*.conf" -exec ls {} \;`
do
mv "$VAR" /tmp
done
# chmod 755 movefiles.sh
# ./movefiles.sh

No comments: