How to access remaining arguments in a fish script

In fish, your arguments are contained in the $argv list. Use list slicing to access a range of elements, e.g. $argv[2..-1] returns all arguments from the second to the last. For example function loop –description “loop <count> <command>” for i in (seq 1 $argv[1]) eval $argv[2..-1] end end Usage $ loop 3 echo hello world … Read more

pipe both, stdout and stderr in the fish shell

That syntax works in fish too. A demo: $ function cmd1 echo “this is stdout” echo “this is stderr” >&2 end $ function cmd2 rev end $ cmd1 | cmd2 this is stderr tuodts si siht $ cmd1 &| cmd2 rredts si siht tuodts si siht Docs: https://fishshell.com/docs/current/language.html#redirects

How do I unset a variable in the fish shell?

Fish uses options on the set command to manipulate shell variables. Unset a variable with the -e or –erase option. set -e myvar Additionally you can define a function function unset set –erase $argv end funcsave unset or an abbreviation abbr –add unset ‘set –erase’ or an alias in ~/.config/fish/config.fish alias unset ‘set –erase’

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)