file - How to get directory permissions in Bash script without backtick evaluation? -
i'm updating bash script in z/os. current script uses result of backtick command test condition, so:
var=`command` [test value of var]
the problem 1 customer has no access /tmp directory, , z/os uses files in /tmp hold intermediate data backtick commands.
i figure test before backtick command /tmp accessibility, , change script's behavior accordingly. i'm not finding way that, though. suggestions?
if [[ -w /tmp ]]...
test if current user has write access /tmp
.
there might alternative. don't have z/os, unixs have variable tmpdir
can set temporary directory, example:
export tmpdir="$home"
might work.
on note, backticks considered deprecated. use var=$(command)
instead.
Comments
Post a Comment