mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 21:21:15 -03:00
functions/seq: Stop using bc in the fallback
Just to remove the dependency - performance is probably about the same. This is used, AFAICT, exclusively on OpenBSD (not Free or Net). CC @zanchey.
This commit is contained in:
@@ -39,10 +39,18 @@ if not command -sq seq
|
||||
end
|
||||
end
|
||||
|
||||
if [ $step -ge 0 ]
|
||||
echo "for( i=$from; i<=$to ; i+=$step ) i;" | bc
|
||||
if test $step -ge 0
|
||||
set -l i $from
|
||||
while test $i -le $to
|
||||
echo $i
|
||||
set i (math $i + $step)
|
||||
end
|
||||
else
|
||||
echo "for( i=$from; i>=$to ; i+=$step ) i;" | bc
|
||||
set -l i $from
|
||||
while test $i -ge $to
|
||||
echo $i
|
||||
set i (math $i + $step)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user