I have my array of arguments "$@" that I would like to reuse in an other process.
Basically what I want is a way to say :
string="$(save_array "$@")"
# save string to a file
And in another process:
# load string from file
arr="$(load_array "$string")"
All solutions I found on stackoverflow seemed to lose some information (eg would not work if some of the items in the array contain newlines or \0
character.
It is OK if the solution uses well known programs (grep/sed/python), but not something not installed on a base system.