Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts

Friday, November 10, 2017

chmod group read/writable on a deep sub-directory under home

On rare cases where you need to provide group read and writable access from a multi-level sub-directory under your home, not that it's recommended from security perspective.  Note when making your home directory readable by group you will have problem with passwordless ssh.

cd ; p="/home/runwuf/project/test/p1/runwuf" ; while [ $p != "/home"  ] ; do chmod g+rw $p ; p=`echo $p | rev | cut -f2- -d"/" | rev` ; done

Tuesday, April 22, 2008

extract the last field in unix shell script

scratch notes on aws exacting the last field!
echo “ABC.123.QIP.ERR” | awk -F. {’print $(NF-0)’}

- dot after F is the field deliminator
- minus zero is the field to extract from backwards of the string