I have used torify
for a while to ad hoc route the traffic of certain applications through Tor and just today noticed that the man page suggests using torsocks
instead. Reading through the torsocks(1)
man page I see the ability to do torsocks on
and torsocks off
to “encapsulate” a larger section of commands instead of having to preface each individual call with torsocks
(or torify
).
However. The given . torsocks on|off
(or using source
instead of the shorthand .
) is not working in dash
or in fish
and seems to be relying on behaviour that appears to be specific to bash
and zsh
(though I didn’t test in other shells than these four).
I’ve used this simple script to test it with the various shells, changing the first line to whichever shell I was trying:
#!/usr/bin/dash
source torsocks on
torsocks show
Is there a way to source torsocks on|off
in a shell that doesn’t do whatever it is bash/zsh is doing here?