Replace tr invocations

This commit is contained in:
Fabian Homborg 2016-02-03 23:46:33 +01:00
parent fcdc6a48c0
commit cadb5d51ea
4 changed files with 5 additions and 5 deletions

View file

@ -3,7 +3,7 @@ if type -q -f sysctl
if sysctl -h >/dev/null ^/dev/null if sysctl -h >/dev/null ^/dev/null
# Print sysctl keys and values, separated by a tab # Print sysctl keys and values, separated by a tab
function __fish_sysctl_values function __fish_sysctl_values
sysctl -a ^/dev/null | tr " = " "\t" sysctl -a ^/dev/null | string replace -a " = " "\t"
end end
complete -c sysctl -a '(__fish_sysctl_values)' -f complete -c sysctl -a '(__fish_sysctl_values)' -f
@ -32,7 +32,7 @@ if type -q -f sysctl
else else
# OSX sysctl # OSX sysctl
function __fish_sysctl_values function __fish_sysctl_values
sysctl -a ^/dev/null | tr ":" "\t" sysctl -a ^/dev/null | string replace -a ":" "\t"
end end
complete -c sysctl -a '(__fish_sysctl_values)' -f complete -c sysctl -a '(__fish_sysctl_values)' -f

View file

@ -4,7 +4,7 @@ function __fish_complete_subcommand -d "Complete subcommand" --no-scope-shadowi
switch "$argv[1]" switch "$argv[1]"
case '--fcs-skip=*' case '--fcs-skip=*'
set -l rest set -l rest
echo $argv[1] | tr = ' ' | read test skip_next string replace -a = ' ' -- $argv[1] | read test skip_next
set -e argv[1] set -e argv[1]
end end

View file

@ -5,6 +5,6 @@ function __fish_print_interfaces --description "Print a list of known network in
echo $i echo $i
end end
else # OSX/BSD else # OSX/BSD
command ifconfig -l | tr ' ' '\n' command ifconfig -l | string split ' '
end end
end end

View file

@ -16,7 +16,7 @@ function down-or-search -d "Depending on cursor position and current mode, eithe
# If we are on the bottom line, start search mode, # If we are on the bottom line, start search mode,
# otherwise move down # otherwise move down
set lineno (commandline -L) set lineno (commandline -L)
set line_count (commandline | wc -l | tr -d ' ') set line_count (count (commandline))
switch $lineno switch $lineno
case $line_count case $line_count