Differece in '-s' and '-e'


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Differece in '-s' and '-e'
# 1  
Old 10-14-2008
Error Differece in '-s' and '-e'

Hi I am using a script which will search for a file.
While i am using '-s' with if condition it is not working.
If i am using the '-e' it is working.
I am searching for a 'trigger file' (0KB File).

Anish.
# 2  
Old 10-14-2008
It should be documented on man test or man your_shell under "Conditional Expressions"

Code:
           -s file        True if file exists and has a size greater than
                          zero.

I'm not sure what -e does as I don't see it there...?
# 3  
Old 10-14-2008
Hi Annihilannic,

e is for 'if exist' .
-s will return the file if the file we are searching is having more than 0KB...right ????
# 4  
Old 10-14-2008
It will return true (return code 0) if the file has more than 0 bytes, yes.
Login or Register to Ask a Question

Previous Thread | Next Thread

1 More Discussions You Might Find Interesting

1. Programming

Differece between "env" and "set" command

Hi, Please clarify what is the difference between "env" and "set" command. I guess set will display the system variables and user defined variables. Thanks Sweta (1 Reply)
Discussion started by: sweta
1 Replies
Login or Register to Ask a Question