Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-01-2008
GenMen GenMen is offline
Registered User
 

Join Date: May 2008
Posts: 1
Grep date from ls -l

I have a script which required the month and day as the input

ex : ./script <Month> <date>

from this I get the list of files to do further logics. The problem is when I assign these $1 and $2 to variables, and use grep command in the script

ls -l |grep "$1 $2"

it works fine for two digit dates, but for single digit dates, it doesnt work as Unix leaves an additional space in the ls -l list..

How can get this done.
Sponsored Links