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
  • Escaping the space with \\ should also do it. Commented Jul 19, 2024 at 17:33
  • That's going to result in nasal demons depending on the contents of the input file. environment variable settings, the directory you call it from, etc. since it's passing the contents of $1 to the shell unquoted. If you were to call date directly from the shell with literal strings as arguments you should enclose them in single quotes, i.e. date -d 'today' '+%d/%m/%Y %H:%M' so you should do the same when calling the shell from awk to execute a command with literal strings, i.e. it should be system("date -d \047" $1 "\047 \047+%d/%m/%Y %H:%M\047") Commented Jul 19, 2024 at 23:28