2009-10-25から1日間の記事一覧
ls -i の出力を加工する #!/bin/sh #file_inode.sh set -- `ls -i -d "$1"` echo "$1" $ ./file_inode.sh 1.text 1407374883568432
#!/bin/sh #fileperm.sh [ -r "$1" ] && rp="readable" || rp="not readable" [ -w "$1" ] && wp="writable" || wp="not writable" [ -x "$1" ] && xp="executable" || xp="not executable" echo "$1 is $rp, $wp and $xp." $ ./fileperm.sh 1.text 1.text i…
ls -l の出力を加工する #!/bin/sh #fileowner.sh if [ $# -ne 2 ]; then echo "Usage: fileowner.sh -u|-g filename" exit 1 fi case "$1" in "-u" ) show="user" ;; "-g" ) show="group" ;; * ) echo "$1: unknown option" exit 1 esac set -- `ls -l -d "…