Reputation: 59
What I am trying to do :
date = `date +%Y%m%d`
Path = "/home/sajeesh/jam_#{date}"
if File.file?(Path)
watch_for(Path, /FATAL/)
else
exit 1
end
So when I do the condition; instead of jam_20170508 its taking jam_#{date} and its exiting; any possible workaround for this.
Thanks!
Upvotes: 0
Views: 41
Reputation: 18762
There seems to be new line in Path
.
Try using
Path = "/home/sajeesh/jam_#{date}".strip
Upvotes: 2