Ask Your Question
0

Ececute a Bash shell command if either of the conditions met

asked 2016-10-06 00:42:26 -0500

rohithmn03 gravatar image

updated 2016-10-06 00:45:02 -0500

image description

Here since i used onlyif, the commands will be executed only when both the test conditions satisfies. But what if i want to execute both the commands if either one of the test conditions satisfies..!?

Please help me here..!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-10-06 10:04:01 -0500

puser gravatar image

updated 2016-10-06 10:21:03 -0500

onlyif => test -f /tmp/file1 || test -f /tmp/file2

Yes @kai thank you

edit flag offensive delete link more

Comments

You mean double pipe: `onlyif => '/usr/bin/test -f /tmp/file0 || /usr/bin/test -f /tmp/file1'`.

Kai Burghardt gravatar imageKai Burghardt ( 2016-10-06 10:19:56 -0500 )edit

Thank you..!

rohithmn03 gravatar imagerohithmn03 ( 2016-10-06 10:23:54 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-10-06 00:42:26 -0500

Seen: 49 times

Last updated: Oct 06 '16