Thread: how to check a directory's permissions in a bash script???
i writing bash script , want check permissions of directory , if set 777 continue rest if not set must
chmod 777 web
how please??
thank
i found script:
at this website. looks though, if incorporate bash, give value want.code:#!/bin/ksh ls -ld $* | awk 'begin {v["r1"]=400; v["w2"]=200; v["x3"]=100; v["s3"]=4100; v["s3"]=4000v["r4"]=40; v["w5"]=20 ; v["x6"]=10; v["s6"]=2010; v["s6"]=2000v["r7"]=4; v["w8"]=2 ; v["x9"]=1; v["t9"]=1001; v["t9"]=1000} {val=0 (i=1;i<=9;i++) val=val+v[substr($0,i+1,1)i] printf "\%4d \%s\n",val,$nf}
you'll have change bolded bit, assigns value variable use in boolean, rather printing it.
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk how to check a directory's permissions in a bash script???
Ubuntu
Comments
Post a Comment