Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 1
    Amazing explanation and works like a charm. Thank you very much. Commented May 12, 2015 at 12:35
  • +1 for a very good answer. But the op may need to change the check to [ "$#" -eq 2 ] , according to his example. And it could be a good idea to also add the date to "tacked_parameters.txt". And I'd go for the general case (ie, not just track of the 2nd parameters when 2 parameters, but track any parameters) : I'd get rid of the if, and have: printf '%s: %s\n' "$(date '+%Y-%m-%dT%H:%M:%S')" "$0 $*" ? (ie, show the command + all the parameters (note that you still lose some info, for example which parameter's had intra-separators, if any). Portable date close to the iso8601 standard) Commented May 12, 2015 at 15:54