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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -