On Tue, Oct 15, 2024 at 16:01:41 +0300, Anssi Saari wrote:
> For decades, I've had an alias like this:
> 
> alias l="ls -lF|more"
> 
> Convenient, no pager unless the directory listing is long. And now it's
> become this code:
> 
> more_version=$(more --version|awk '{print $4}'|cut -d. -f1-2)
> if [[ $more_version -ge 2.38 ]]
> then
>     alias l='ls -lF|more --exit-on-eof'
> else
>     alias l='ls -lF|more'
> fi

Why did you make it so complicated?  What's wrong with simply:

    alias l='ls -lF|more -e'

or perhaps:

    export MORE=-e
    alias l='ls -lF|more'

And by the way, this line:

    if [[ $more_version -ge 2.38 ]]

is not correct.  Bash can't do a floating point numeric comparison.  This
syntax simply gives an error message:

hobbit:~$ [[ 2.1 -ge 2.2 ]]
bash: [[: 2.1: syntax error: invalid arithmetic operator (error token is ".1")

Are you using some other shell, maybe?  Like zsh?

Reply via email to