help-bash
[Top][All Lists]
Advanced

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

Re: how to print all 3 char length string made whitespace {0..9} {a..z}


From: Eli Schwartz
Subject: Re: how to print all 3 char length string made whitespace {0..9} {a..z}
Date: Sun, 2 Aug 2020 16:18:06 -0400

On 8/2/20 3:44 PM, Peng Yu wrote:
> Hi,
> 
> If it were just {a..z}, `echo {a..z}{a..z}{a..z}` can be used. But I
> don't see there is a way to concatenate whitespace, {0..9} and {a..z}.
> 
> Is there a good way to generate all three-character strings made of
> whitespace, {0..9} and {a..z}? Thanks.

You can always use multiple brace expansions together:

$ printf "<%s>\n" {{a..z}," ",{0..9}}

Though I'd first want to ask what you're really trying to do...
(I know, I know, you'll never tell us...)

-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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