What does this do in bash: [@]?

Peter Flynn peter at silmaril.ie
Sat Jul 30 09:19:19 UTC 2022


On 30/07/2022 00:41, Colin Watson wrote:
[...]
> This sort of thing is generally much easier in Python, 

It's actually much easier in pretty much anything except the shell :-)

On 30/07/2022 05:57, Jon LaBadie wrote:
[...]
 > URL=('https://tokens.somesite.com' + long stretch of arguments)
 >
 > would be creating an array "URL" where the first argument (0) is
 > https://tokens.somesite.com" and the remainder are the stretch
 > of args.

Only if there is the defined separator (eg a space) between the site 
address and the argument string (after the # or ?). Otherwise the entire 
URI is an opaque string. Unless, in your example above, you mean you 
provide the data already split up, like

URL=('https://tokens.somesite.com' 'id' 'abc' 'lastpage' '37')

But to do that you would still have had to parse them apart in some 
prior stage.

Peter




More information about the ubuntu-users mailing list