help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does {x..y} supposed to work?


From: Greg Wooledge
Subject: Re: How does {x..y} supposed to work?
Date: Fri, 14 May 2021 19:10:16 -0400

On Fri, May 14, 2021 at 05:59:56PM -0500, Dennis Williamson wrote:
>  chr ()
>  {
>      local c;
>      for c in "$@";
>      do
>          printf "\\$(($c/64*100+$c%64/8*10+$c%8)) ";
>      done
>  }

You know you can convert decimal to octal with printf -v var %03o, right?

>  $ chr {51..65}; echo
>  3 4 5 6 7 8 9 : ; < = > ? @ A

Really needs to store the results in a (non-local) array, rather than
dumping them to stdout.  IMHO.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]