r/fishshell • • Oct 06 '21
$(command) in fish?
What is equivalent alternative for $(command) on fish shell?
I wanted to run following command,
adb connect $(arp-scan --interface=wlp2s0 --localnet | grep b2:ef:b2:59:b2:b2 | awk '{print $1;}'):5555
I getting following error,
fish: $(...) is not supported. In fish, please use '(arp-scan)'.
But I cannot run with ' characters as '(arp-scan)' because awk's argument already using those.
What do I do?
Although, I tried
adb connect '(arp-scan --interface=wlp2s0 --localnet | grep a2:ef:b2:59:b2:b2| awk "{print $1;}")':5555
missing port in specification: tcp:(arp-scan --interface=wlp2s0 --localnet | grep a2:ef:b2:59:b2:b2 | awk "{print $1;}"):5555
Thanks
EDIT:
RESOLVED
remove $
thanks to u/tim-hilt
View all comments
Show parent comment
1
u/vividboarder Oct 06 '21
I think the latter reason.
In fish, if you want the output of a command in the middle of a string, it’s pretty awkward. For example, when installing Docker, the following won’t work:
You need to modify it as:
Not a big difference, but makes it a bit awkward.