#!/bin/bashRPCV="$(sudo-Hiurootenv|grep'^PATH'|cut-d=-f2)"echo"$RPCV"|grep-q"::"&&echo"root's path contains a empty directory (::)"echo"$RPCV"|grep-q":$"&&echo"root's path contains a trailing (:)"forxin$(echo"$RPCV"|tr":"" ");doif[-d"$x"];thenls-ldH"$x"|awk'$9 == "." {print "PATH contains current working directory (.)"} $3 != "root" {print $9, "is not owned by root"} substr($1,6,1) != "-" {print $9, "is group writable"} substr($1,9,1) != "-" {print $9, "is world writable"}'elseecho"$x is not a directory"fidone