Skip to content
Advertisement

bash command XOR ^ anothercommand

In the example below:

w ^ ls

what’s the expected behaviour of the XOR operator in shell?

So when we enter

command ^ anothercommand

what triggers anothercommand to run (if it will execute at all)?

Advertisement

Answer

If you enter command ^ anothercommand, you are simply providing command with two arguments, ^ and anothercommand. There is no operator here. anothercommand will only run if command decides to treat that argument as a command name and attempt to run it.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement