I've recently found here a solution to my problem, but I can't completely understand what everything in this command means:
xdg-open "$@">/dev/null 2>&1
I've recently found here a solution to my problem, but I can't completely understand what everything in this command means:
xdg-open "$@">/dev/null 2>&1
"$@"
"$@"
is equivalent to"$1" "$2" ...
(the positional parameters to the command, good to use when there are special characters, for example spaces, within the parameters).From
man bash
:>
Redirection of standard output to a file
/dev/null
The special file that means that the output will be redirected 'nowhere' in other words not written anywhere.
See
man null
for more details.2>
Redirection of error output to a file
2>&1
Redirection of error output to standard output
From
man bash
:"$@"
: all arguments of a script or function call.>
: means redirectstdout
(same as1>
).>/dev/null
: means redirectstdout
to/dev/null
, meaning just trash the output.2>&1
Redirect errout (2>
) to stdout (&1
).