How can shell arguments be stored in a file for later use when saving citations?
To be clear: I don't want to pass arguments in place, which can easily be done with "$@". But actually you need to store them in a file for later use.
#!/bin/sh
storeargs() {
:
}
if "$1"
then
useargs "$@"
storeargs "$@"
else
eval useargs $(cat store)
fi
.
$ foo 'a "b"' "c 'd'" '\'' 'd
e'
$ foo
The question probably boils down to how to quote a string using common tools in general (awk, perl, ...). I would prefer a solution that does not make the quoted string unreadable. The content storeshould look more or less like what I specify on the command line.
, /, , (shell) / () , .