Description of problem: There is important difference between the behaviour of ls and lsattr. If the file does not exist, ls exits with non-zero code. In the same situation lsattr pretends that non-existent file is OK and exits with 0. Version-Release number of selected component (if applicable): e2fsprogs-1.41.4-1.fc10 How reproducible: always Steps to Reproduce: $ ls output.txt ls: cannot access output.txt: No such file or directory $ echo $? 2 $ lsattr output.txt lsattr: No such file or directory while trying to stat output.txt $ echo $? 0 Actual results: lsattr exits with 0 Expected results: lsattr exits with non-zero Additional info:
Since lsattr takes more than one file as an argument, I'm not sure what the standard is for return values if only some have errors... will look into it.
looks like ls will return an error if any arg has a problem: # ls foo bar baz blah TODO ls: cannot access foo: No such file or directory ls: cannot access bar: No such file or directory ls: cannot access baz: No such file or directory ls: cannot access blah: No such file or directory TODO # echo $? 2
sent a patch upstream for this. # misc/lsattr foo bar baz blah TODO misc/lsattr: No such file or directory while trying to stat foo misc/lsattr: No such file or directory while trying to stat bar misc/lsattr: No such file or directory while trying to stat baz misc/lsattr: No such file or directory while trying to stat blah -------------e- TODO # echo $? 2 Sorry for the long delay. :)
Fixes for these are upstream now, and will be pulled into Fedora w/ the next e2fsprogs rebase. It'll probably only make it to F11 unless you have a specific need for F10; if so just let me know.