On Thu, Dec 15, 2022 at 10:55:51AM +0000, [email protected] wrote:
> function sa {
> for y in $(seq $1 $e2); do
> echo "echo search $y "
> done
> }
As others have pointed out, you've written $e2 instead of $2.
In addition to that, you're relying on the Linux-specific seq(1)
program, which may not be available on other systems. You could
use a C-style for loop instead:
function sa {
local y
for ((y=$1; y <= $2; y++)); do
echo "echo search $y"
done
}
This is more portable, as well as more efficient.