Ask Your Question

Ececute a Bash shell command if either of the conditions met

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

rohithmn03 gravatar image

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

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

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

puser gravatar image

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

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

Yes @kai thank you

edit flag offensive delete link more


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 -0600 )edit

Thank you..!

rohithmn03 gravatar imagerohithmn03 ( 2016-10-06 10:23:54 -0600 )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


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

Seen: 97 times

Last updated: Oct 06 '16