if [ fexist $1 ]; then
if [ file_date $1 -gt $someotherfile ]; then
# ...
fi
fi
Thanks.
bash scripting question
I have virtually no idea how to do this, and I have spent ages googling (I have tried).
Quote: Original post by Genjix
I have virtually no idea how to do this, and I have spent ages googling (I have tried).if [ fexist $1 ]; then if [ file_date $1 -gt $someotherfile ]; then # ... fi fi
Thanks.
I might help if you explained what you are trying to do.
"THE INFORMATION CONTAINED IN THIS REPORT IS CLASSIFIED; DO NOT GO TO FOX NEWS TO READ OR OBTAIN A COPY." , the pentagon
if file exists{ if files date > someotherfile { do stuff }}
sorry, but I don't really know how to phrase it.
If a file is older than another file, perform some actions?
In case you were wondering what to put in your next christian game; don't ask me, because I'm an atheist, an infidel, and all in all an antitheist. If that doesn't bother you, visit my site that has all kinds of small utilities and widgets.
you could use the -nt or -ot for conditional expressions, i.e.
#file exist?if [ -f $1 ]; then if [ $1 -nt somefilename ]; then #file is newer(based on modification date) than somefilename fifi
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement