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.
if file exists{ if files date > someotherfile { do stuff }}
sorry, but I don't really know how to phrase it.
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