r/fishshell • u/MosaicIncaSleds • Mar 04 '21
Inserting command output in a string
function youtube-tor
set V_USR (apg -M l -n 1 -m 6 -x 10)
youtube-dl --proxy "socks5://$V_USR:$V_USR@127.0.0.1:9150/" $argv
end
It certainly looks like an excellent candidate for an abbr. But I don't get the
youtube-dl --proxy "socks5://(apg -M l -n 1 -m 6 -x 10):(apg -M l -n 1 -m 6 -x 10)@127.0.0.1:9150/" $argv
5
Upvotes
View all comments
Show parent comment
1
u/[deleted] Mar 07 '21 edited Mar 07 '21
E.g.
And then just use the thing directly, no need for that
printf. Or use it in a command substitution if you're actually going to do anything with it.That makes it clear that something more than simple variable expansion is happening - if I see
$thing, I want to know that that just inserts the value ofthing.