aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/umask.fish
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2015-09-09 20:55:04 +0200
committerGravatar Fabian Homborg <FHomborg@gmail.com>2015-09-09 20:55:04 +0200
commitb85a8bbbfed56f603dca5d6da85858f9c973b669 (patch)
treeaaca0722b25cff9d5e2ea5b46ad6e7dc59d9ec6d /share/functions/umask.fish
parent925f4517739ed564edcac6dd5ed29c2835461da9 (diff)
Rename sgrep to __fish_sgrep
Makes it harder to cause issues with aliases, see fish-shell#2245
Diffstat (limited to 'share/functions/umask.fish')
-rw-r--r--share/functions/umask.fish12
1 files changed, 6 insertions, 6 deletions
diff --git a/share/functions/umask.fish b/share/functions/umask.fish
index d68fb4dd..a03c39b7 100644
--- a/share/functions/umask.fish
+++ b/share/functions/umask.fish
@@ -1,13 +1,13 @@
function __fish_umask_parse -d "Internal umask function"
# Test if already a valid octal mask, and pad it with zeros
- if echo $argv | sgrep -E '^0?[0-7]{1,3}$' >/dev/null
+ if echo $argv | __fish_sgrep -E '^0?[0-7]{1,3}$' >/dev/null
set -l char_count (echo $argv| wc -c)
for i in (seq (math 5 - $char_count)); set argv 0$argv; end
echo $argv
else
# Test if argument really is a valid symbolic mask
- if not echo $argv | sgrep -E '^(((u|g|o|a|)(=|\+|-)|)(r|w|x)*)(,(((u|g|o|a|)(=|\+|-)|)(r|w|x)*))*$' >/dev/null
+ if not echo $argv | __fish_sgrep -E '^(((u|g|o|a|)(=|\+|-)|)(r|w|x)*)(,(((u|g|o|a|)(=|\+|-)|)(r|w|x)*))*$' >/dev/null
printf (_ "%s: Invalid mask '%s'\n") umask $argv >&2
return 1
end
@@ -72,19 +72,19 @@ function __fish_umask_parse -d "Internal umask function"
set mode set
end
- if not echo $perm|sgrep -E '^(r|w|x)*$' >/dev/null
+ if not echo $perm| __fish_sgrep -E '^(r|w|x)*$' >/dev/null
printf (_ "%s: Invalid mask '%s'\n") umask $argv >&2
return
end
set val 0
- if echo $i |sgrep 'r' >/dev/null
+ if echo $i | __fish_sgrep 'r' >/dev/null
set val 4
end
- if echo $i |sgrep 'w' >/dev/null
+ if echo $i | __fish_sgrep 'w' >/dev/null
set val (math $val + 2)
end
- if echo $i |sgrep 'x' >/dev/null
+ if echo $i | __fish_sgrep 'x' >/dev/null
set val (math $val + 1)
end