如何測試魚殼中是否存在子串?例如,switch表達式中: set myvar "a long test string"
switch $myvar
case magical-operator-here "test string"
echo 'yep!'
case '*'
echo 'nope!'
end
我想創建一個cd函數,它擴展了當前cd函數(在我的機器上)的生命期爲/usr/local/Cellar/fish/2.6.0/share/fish/functions/cd.fish。這可能嗎? 因此,像這樣: function cd
if i_can_handle_it
do_my_thing_with $argv
else
call /usr/loc
擺弄fish_vi_key_bindings,我很想知道這個函數在哪裏定義。我的直覺是,函數存在於~/.config/fish/functions以外的文件中,但我看不到它們。 我如何知道該函數的定義在哪裏?像 function funcfile the-func -d 'show the file for a function'
...
end