分类:
2009-09-18 13:29:05
ls -lt|sed -e'2!d'|awk '{print $8}' |
chmod u+x $(file $(ls -t ) |sed -ne '/shell script text executable/p'|sed -e 's/://'|awk '{print $1}' |sed -n '1p') |
#!/bin/bash files=`ls -l | sort -k6,7 -r| awk '{print $8}'` for subfile in $files do file "$subfile" | grep "executable" > /dev/null if [ $? -eq 0 ];then chmod u+x -v "$subfile" exit 0
fi done |