Kumar Asked: 2010-02-01 21:50:20 +0800 CST2010-02-01 21:50:20 +0800 CST 2010-02-01 21:50:20 +0800 CST How to use grep commend with variable 772 How can i use grep commend with variable ? I stored ' Feb 1 ' (future it will be changeable) to variable 'date'. Now i want to grep this variable 'date', How can i do this ? linux grep 1 Answers Voted Best Answer einstiien 2010-02-01T21:55:59+08:002010-02-01T21:55:59+08:00 This should work: DATE='Feb 1' grep "$DATE" [filename] You need to put quotes around it because of the space in your variable.
This should work:
You need to put quotes around it because of the space in your variable.