I'm trying to get the file of the current date with the following command in HP-UX Unix:$ lt ABC.LOG* |grep `date +%b %d`But, it's giving me the error:ksh: : cannot executegrep: can't open %dAny suggestions?
quotes inside backticks inside quotes in ksh
quoting;ksh;timestamps;hp ux
The error stems from the quoting of the arguments of grep and the fact that backticks don't do nesting very well:grep `date +%b %d`This is better written asgrep `date +'%b %d'`... or even better,grep $(date +'%b %d')In fact, with $(...) instead of backticks, you should be able to keep the inner double quotes:grep $(date +%b %d)An alternative to grepping the output of ls would be to dofind . -type f -name ABC.LOG* -ctime -1This would find all regular files (-type f) in the current directory whose names matches the given pattern and whose ctime is less than 24 hours since the current time.  A file's ctime is the time when the last modification of the file's data or metadata was made.This is not exactly equivalent to what you're trying to achieve though. This also recurses into subdirectories.