about -w


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting about -w
# 8  
Old 05-14-2012
ah... i found the problem.. im in directory path2 and i go and type all the path...

Code:
directory = `dirname /path1/path2/path3/file.txt`

if [ -w "$directory" ]
then
   echo $?
else
   echo $?
fi

# 9  
Old 05-14-2012
Try to remember to not put space characters around the equals sign in a Bourne Shell variable assignment.

Not the first time ...
https://www.unix.com/shell-programmin...tax-error.html
This User Gave Thanks to methyl For This Post:
# 10  
Old 05-14-2012
haha yeh ill try to remember that, used to java coding..

Thanks for the warning methyl, jim mcnamara and chakrapani
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question