Why does 'test -f' and 'test -e' return true on a (hidden) file that doesn't exist?
*> cat /home/talberts/.forward* cat: /home/talberts/.forward: No such file or directory *> test -f /home/talberts/.forward ;echo $?* 1 *> test -e /home/talberts/.forward ;echo $?* 1
On Mon, March 31, 2008 4:37 pm, Tim Alberts wrote:
Why does 'test -f' and 'test -e' return true on a (hidden) file that doesn't exist?
*> cat /home/talberts/.forward* cat: /home/talberts/.forward: No such file or directory *> test -f /home/talberts/.forward ;echo $?* 1 *> test -e /home/talberts/.forward ;echo $?* 1
0 = exists 1 = does not exist
Marko A. Jennings wrote:
On Mon, March 31, 2008 4:37 pm, Tim Alberts wrote:
Why does 'test -f' and 'test -e' return true on a (hidden) file that doesn't exist?
*> cat /home/talberts/.forward* cat: /home/talberts/.forward: No such file or directory *> test -f /home/talberts/.forward ;echo $?* 1 *> test -e /home/talberts/.forward ;echo $?* 1
0 = exists 1 = does not exist
I'm backwards. Doh! thank you
On Mon, Mar 31, 2008 at 04:43:28PM -0400, Marko A. Jennings alleged:
On Mon, March 31, 2008 4:37 pm, Tim Alberts wrote:
Why does 'test -f' and 'test -e' return true on a (hidden) file that doesn't exist?
*> cat /home/talberts/.forward* cat: /home/talberts/.forward: No such file or directory *> test -f /home/talberts/.forward ;echo $?* 1 *> test -e /home/talberts/.forward ;echo $?* 1
0 = exists 1 = does not exist
And to expand on that a bit... shell commands do not return the normal boolean true/false, they return zero for success and non-zero for errors.
Using non-zero for errors is handy for indicating the type or reason for the error.
Tim Alberts wrote:
Why does 'test -f' and 'test -e' return true on a (hidden) file that doesn't exist?
*> cat /home/talberts/.forward* cat: /home/talberts/.forward: No such file or directory *> test -f /home/talberts/.forward ;echo $?* 1 *> test -e /home/talberts/.forward ;echo $?* 1
It doesn't:
[root@gandalf ~]# cat /tmp/.test1 test1 [root@gandalf ~]# test -f /tmp/.test1 ; echo $?* 0* [root@gandalf ~]# test -f /tmp/.test1 ; echo $? 0
[root@gandalf ~]# cat /tmp/.test2 cat: /tmp/.test2: No such file or directory [root@gandalf ~]# test -f /tmp/.test2 ; echo $? 1 [root@gandalf ~]# test -e /tmp/.test2 ; echo $? 1 [root@gandalf ~]#
On Mon, Mar 31, 2008 at 01:37:01PM -0700, Tim Alberts wrote:
Why does 'test -f' and 'test -e' return true on a (hidden) file that doesn't exist?
*> cat /home/talberts/.forward* cat: /home/talberts/.forward: No such file or directory *> test -f /home/talberts/.forward ;echo $?* 1 *> test -e /home/talberts/.forward ;echo $?* 1
"0" means true
% test 1 == 1 ; echo $? 0 % test 1 == 2 ; echo $? 1 % test 1 == 1 && echo good good
(BTW, putting * around lines you type is REALLY bad quoting style)
Tim Alberts wrote:
Stephen Harris wrote:
(BTW, putting * around lines you type is REALLY bad quoting style)
Copied from HTML into email program. then sent as plain text. complain to thunderbird.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Don't use HTML, complain to user :)
Rudi Ahlers wrote:
Tim Alberts wrote:
Stephen Harris wrote:
(BTW, putting * around lines you type is REALLY bad quoting style)
Copied from HTML into email program. then sent as plain text. complain to thunderbird.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Don't use HTML, complain to user :)
Wow folks. Is this really worth complaining about? Why waste time writing email clients that use HTML if people are gonna whine about it?
AGAIN.. I copied from HTML output into mozilla thunderbird...I sent the email as PLAIN TEXT...if you don't like how mozilla thunderbird deals with it...complain to them... but fundamentally go somewhere else with this petty complaint.
Tim Alberts wrote:
Rudi Ahlers wrote:
Tim Alberts wrote:
Stephen Harris wrote:
(BTW, putting * around lines you type is REALLY bad quoting style)
Copied from HTML into email program. then sent as plain text. complain to thunderbird.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Don't use HTML, complain to user :)
Wow folks. Is this really worth complaining about? Why waste time writing email clients that use HTML if people are gonna whine about it?
AGAIN.. I copied from HTML output into mozilla thunderbird...I sent the email as PLAIN TEXT...if you don't like how mozilla thunderbird deals with it...complain to them... but fundamentally go somewhere else with this petty complaint.
Relax man, didn't you see the smiley face ? It wasn't meant as an insult. But, to reply to your HTML query, it's simply with 50 emails coming in, and 10 replies per email, plain text isn't as heavy on everyone's bandwidth as HTML. But again, I'm not taking you on about this
Rudi Ahlers wrote:
Relax man, didn't you see the smiley face ?
Hey man, would you please trim replies in the future.. Five miles of quoted text is actually worse than html mail ;)
On 31/03/2008, Rudi Ahlers Rudi@softdux.com wrote:
insult. But, to reply to your HTML query, it's simply with 50 emails coming in, and 10 replies per email, plain text isn't as heavy on everyone's bandwidth as HTML. But again, I'm not taking you on about this
Perhaps, Rudi, you will just look again at what you've written (above) and re-consider the advertisment present at the bottom of every e-mail _you_ send to this global mailing list (below).
Alan.
--
Kind Regards Rudi Ahlers CEO, SoftDux
Web: http://www.SoftDux.com Check out my technical blog, http://blog.softdux.com for Linux or other technical stuff, or visit http://www.WebHostingTalk.co.za for Web Hosting stuff
On Mon, Mar 31, 2008 at 02:13:26PM -0700, Tim Alberts wrote:
Stephen Harris wrote:
(BTW, putting * around lines you type is REALLY bad quoting style)
Copied from HTML into email program. then sent as plain text. complain to thunderbird.
No. Complain to person who _did_ it.
Technology is merely a tool. It requires a brain to use the tools properly. We all make mistakes. Learn from this one and don't trust cut'n'paste systems in future. They _will_ do the wrong thing.