关于鱼的文献不多。我需要知道是否
date '+%k' is greater than 8
Run Code Online (Sandbox Code Playgroud)
我该怎么做?谢谢。
test or [ are the way you would do this. This is true of all shells, since these are external commands.
if [ (date '+%k') -ge 8 ]
echo "It's larger!"
end
Run Code Online (Sandbox Code Playgroud)
You can use the test fish builtin, like:
if test (date +%k) -gt 8
...
end
Run Code Online (Sandbox Code Playgroud)