On Tue, Feb 19, 2019, at 09:20, David Croll wrote:
> In the meanwhile, I wonder when the "watch" command will be implemented 
> in fish.
> 
> Define a function:
> 
> function f
>      echo "f"
> end
> 
> Then:
> 
> watch -n 10 "f"
> 
> does not work, as watch runs in bash, and bash doesn't know of the fish 
> function I've just defined.
> 
> I can only do
> 
> while true
>      f
>      sleep 10
> end
> 
> as a workaround.

Hello.  I hope that the "watch" command does not get implemented in fish, as 
that would be needless duplication.  Regarding "I can only do ... as a 
workaround", there are other workarounds.  You can write a script and you can 
save the function as explained in https://unix.stackexchange.com/a/474633.

function f
    echo f
end

funcsave f

watch --exec fish -c f


_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to