Set awk output to variable in fish shell Set awk output to variable in fish shell unix unix

Set awk output to variable in fish shell


scala is going into the background, starting a REPL because it thinks stdin is a terminal. This works for me:

set installed_version (scala -version 2>&1 < /dev/null | awk 'NR==1{ print $5 }')echo $installed_version


This is fish bug #1949 - fish doesn't run command substitutions in a subprocess, and so leaves stdin connected to the tty. Because of that, some tools don't behave as the should.

Joe Hildebrand's workaround (explicitly redirect </dev/null) is the right thing to do currently.