Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if_existing functionality #318

Closed
plikhari opened this issue Sep 4, 2016 · 2 comments
Closed

if_existing functionality #318

plikhari opened this issue Sep 4, 2016 · 2 comments

Comments

@plikhari
Copy link

plikhari commented Sep 4, 2016

if_existing does not work if you have an executable line - here template5 and template7 are files - cat will execute and create the test file even if ${template5} file does not exist.

${if_existing ${template5}}${execpi 11 cat ${template7} > /tmp/test }${endif}

However if I do not output to the test file ( > /tmp/test part removed )- it does not show on the conky output and works fine.

The point being - why is ${if_existing} reaching cat if the ${template5} file does not exist - should it not jump to the next statement after ${endif} ???

@plikhari
Copy link
Author

OK figure it out ;-)
The above functionality as per design is correct !

But what if one needs to check for an existence of a file - then following works
${texecpi 10 if [ -s ${template1} ]; then do something here; fi }

@lasers
Copy link
Contributor

lasers commented Aug 11, 2018

Sounds like you ran into this bug #334. EDIT: I see you raised here... Smh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants