for p in *.HEIC;
heif-convert $p (path change-extension jpg $p)
end
Note the path
command required fish 3.5
set var1 (pwd)
echo $var1
A command substitution can have a dollar sign before the opening parenthesis like outercommand $(innercommand)
. This variant is also allowed inside double quotes. When using double quotes, the command output is not split up by lines.
For example,
second line" > myfile
set myfile "$(cat myfile)"
printf $myfile
prints
first line
second line⏎
without the double quotes this is first line second line
Between single quotes, fish performs no expansions. Between double quotes, fish only performs variable expansion.