mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 04:13:08 +00:00
Replace tr
invocations
This commit is contained in:
parent
fcdc6a48c0
commit
cadb5d51ea
4 changed files with 5 additions and 5 deletions
|
@ -3,7 +3,7 @@ if type -q -f sysctl
|
|||
if sysctl -h >/dev/null ^/dev/null
|
||||
# Print sysctl keys and values, separated by a tab
|
||||
function __fish_sysctl_values
|
||||
sysctl -a ^/dev/null | tr " = " "\t"
|
||||
sysctl -a ^/dev/null | string replace -a " = " "\t"
|
||||
end
|
||||
|
||||
complete -c sysctl -a '(__fish_sysctl_values)' -f
|
||||
|
@ -32,7 +32,7 @@ if type -q -f sysctl
|
|||
else
|
||||
# OSX sysctl
|
||||
function __fish_sysctl_values
|
||||
sysctl -a ^/dev/null | tr ":" "\t"
|
||||
sysctl -a ^/dev/null | string replace -a ":" "\t"
|
||||
end
|
||||
|
||||
complete -c sysctl -a '(__fish_sysctl_values)' -f
|
||||
|
|
|
@ -4,7 +4,7 @@ function __fish_complete_subcommand -d "Complete subcommand" --no-scope-shadowi
|
|||
switch "$argv[1]"
|
||||
case '--fcs-skip=*'
|
||||
set -l rest
|
||||
echo $argv[1] | tr = ' ' | read test skip_next
|
||||
string replace -a = ' ' -- $argv[1] | read test skip_next
|
||||
set -e argv[1]
|
||||
end
|
||||
|
||||
|
|
|
@ -5,6 +5,6 @@ function __fish_print_interfaces --description "Print a list of known network in
|
|||
echo $i
|
||||
end
|
||||
else # OSX/BSD
|
||||
command ifconfig -l | tr ' ' '\n'
|
||||
command ifconfig -l | string split ' '
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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,
|
||||
# otherwise move down
|
||||
set lineno (commandline -L)
|
||||
set line_count (commandline | wc -l | tr -d ' ')
|
||||
set line_count (count (commandline))
|
||||
|
||||
switch $lineno
|
||||
case $line_count
|
||||
|
|
Loading…
Reference in a new issue