Created
June 10, 2013 06:43
-
-
Save gak/5746941 to your computer and use it in GitHub Desktop.
My custom fish prompt code explained at http://geraldkaszuba.com/tweaking-fish-shell/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Show disk usage when low | |
set -l du (df / | tail -n1 | sed "s/ */ /g" | cut -d' ' -f 5 | cut -d'%' -f1) | |
if test $du -gt 80 | |
error du $du%% | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
instead of line 2:
much shorter way:
2 commands in subshell instead of 5! xD
EDIT: for exact string (without "%" and without using cut) you could use