Le 07/06/2012 06:00, Clark WANG a écrit :
On Thu, Jun 7, 2012 at 11:31 AM, Aaron Davies<[email protected]>  wrote:
how can i recover the command line used to launch a script from inside itself 
(up to a difference in quote types)?

for v in "$@"; do
   printf ' %q' "$v";
done;
print

printf "$0"
printf " %q" "$@"

is sufficient.

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html

EXTENDED DESCRIPTION
...
9. The format operand shall be reused as often as necessary to satisfy the argument operands.
...

Regards,

Cyrille Lefevre
--
mailto:[email protected]


_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to