Unix - Permission denied -


i created 2 files in unix, filename1 , filename2. able see contents of both files. when executing 1 command

filename1 >& filename2 

i not able open file filename2. throwing error

/.filename1 : permission denied. 

complete code:

bash-4.3$ cat>filename1 hi bash-4.3$ cat> filename2 hi bash-4.3$ cat filename1 hi bash-4.3$ cat filename2 hi bash-4.3$ filename1 >& filename2 bash-4.3$ cat filename1 hi bash-4.3$ cat filename2 bash: ./filename1:permission denied 

run

chmod +x filename1 chmod +w filename2 

need check clobber setting well. depends on shell being used. google it!

edit

for bash

set +o noclobber 

then can overwrite files. not idea


Comments