I am using QNX to compare dates of files created. Using QNX I cannot use any of the commonly referenced answers to this frequent question.
I cannot use date for anything other than current date modification
Any other ideas out there?
I am using QNX to compare dates of files created. Using QNX I cannot use any of the commonly referenced answers to this frequent question.
I cannot use date for anything other than current date modification
Any other ideas out there?
The QNX shell environment is a mix of GNU extensions and POSIX components and lacks some widely available basic features in several utilities. As well, the command switches that are often referenced in Unix, OSX. Linux documentation for finding file creation/modification/access dates and for comparing or converting these dates to epoch time for ease of date calculation in the shell (date arithmetic), are not supported.
As I noted in my comment this was discussed in another question recently. QNX's find
has GNU -printf
extensions so can be used for part of this but this must use QNX strftime
which seems to lack support for formatting dates as epoch values. In one of my answers to that question I show how to use GNU find
to get date information from files. QNX's date
lacks the -s
, -d,
and --date
switches from GNU coreutils date
for easy conversions nor does it include modern BSD/POSIX -j
and -f
switches (which work for conversion to/from epoch to current time). BSD date
also includes date adjustment with its -v
switch for doing basic date arithmetic. This is similar to the functionality offered by the --date
switch of GNU date
. These are useful and basic functions that would be needed for running/porting a lot of existing shell scripts, but QNX doesn't seem to have them.
Some hackish workarounds are demoed at the question linked to above. Hopefully QNX gurus will show the correct methods (sh/ksh
tricks?) for doing this or feature requests will prompt QNX to update some of these core Unix/POSIX utilities :-)
Cheers,