Re: printf -v doesn't allow array assignment

2009-07-19 Thread Chet Ramey
Chris F.A. Johnson wrote: > > $ printf -v q[2] "%s" "$RANDOM" > bash: printf: `q[2]': not a valid identifier > > > I know I can work around it with a temporary variable, but it > would be nice if it could be done in a single step. That could be a useful extension. It will probably find

Re: printf -v doesn't allow array assignment

2009-07-18 Thread Stephane CHAZELAS
2009-07-17, 22:02(-04), Chris F.A. Johnson: > > $ printf -v q[2] "%s" "$RANDOM" > bash: printf: `q[2]': not a valid identifier > > > I know I can work around it with a temporary variable, but it > would be nice if it could be done in a single step. [...] Just do a "touch q2" before and t

printf -v doesn't allow array assignment

2009-07-17 Thread Chris F.A. Johnson
$ printf -v q[2] "%s" "$RANDOM" bash: printf: `q[2]': not a valid identifier I know I can work around it with a temporary variable, but it would be nice if it could be done in a single step. -- Chris F.A. Johnson =