George Hallam
11-15-2011, 09:32 AM
Im trying to write a program in bash that will return (print out to screen)
0 if the file i inputted exists and was modified within the past 20 mins
1 if the file i inputted exists and was not modified within the past 20 mins
2 the file i inputted does not exist
the file i input will be enter as a 1st command line argument after the code
i know that i have to use find -mmin -20 and that will return the files name if it was modified within the past 20 mins, but i cant get it to output just a 0 r a 1 =/
any ideas
0 if the file i inputted exists and was modified within the past 20 mins
1 if the file i inputted exists and was not modified within the past 20 mins
2 the file i inputted does not exist
the file i input will be enter as a 1st command line argument after the code
i know that i have to use find -mmin -20 and that will return the files name if it was modified within the past 20 mins, but i cant get it to output just a 0 r a 1 =/
any ideas