[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash: get file modification time query



Robin Gerard wrote:

On Wed, Jul 09, 2003 at 05:32:25PM -0700, Vineet Kumar wrote:
* David selby (debian@pusspaws.net) [030709 12:08]:
Is there a neater way to get a modification date for a file without ls -l & sed ? I have a bash script that needs to get the info. Because the file size varies I cannot use cut, it may cut the wrong bit.
stat -c "%y" $filename
for me: stat -c "%y" filename works but stat -c "%y" $filename doesn't.

Hi!
the $filename is used in shell script like the following

for filename in /home/foo do
   stat -c %y $filename

--
Zhao YouBing, Ph.D student
State Key Lab of CAD&CG,Zhejiang University,
Hangzhou, 310027, P.R.China
Tel  : 0571-87951045(O), 87933444(H)
Email: zhaoyb@cad.zju.edu.cn
MSN  : zhaoyoubing@hotmail.com




Reply to: