3 ms·
> Or error messages which return translated commands? Fish does this in some cases: ~> echo $(true) fish: $(...) is not supported. In fish, please use '(t
by duckerude 6y ago
> Or error messages which return translated commands?
Fish does this in some cases:
~> echo $(true)
fish: $(...) is not supported. In fish, please use '(true)'.
echo $(true)
^
> (I recognize not all commands can be translated, but all of those that would be run by a beginner can be)
Not all of them, unfortunately.
Consider `while true; do something; done`. Fish interprets this as an unclosed while loop, where `do` and `done` are ordinary commands. So if you enter it you don't get a syntax error, fish just waits for more input until you enter `end`. The same goes for `if` and `for`.
- maximilianroos 6y agoGood point on the loop, I hadn't thought about that, thanks for correcting me. On the error messages, I was thinking even clearer for beginners, giving them the whole statement, to avoid uncertainties around where the quotes should be included in '(true)'. Maybe even a shortcut to paste the corrected line in their terminal. echo $(true) ^ fish: $(...) is not supported. In fish, please use '(true)', like: echo (true) Alt+r will insert this line in your terminal.