Hello,
I'm trying to use cut command to retrieve timestamp from a list of files in a certain folder. It seems that cut command mesing up with the spaces
fileTimestamp="`ls -l ${BASE_DIR}/some_dir/${fileName}`" --I
somevar="`echo $fileTimestamp | cut -c 1-40`" ---II
The results of the (II) does not preserve spaces:
-rw-rw-rw- 1 d13ukas vzwadmin 4706 Aug 1
-rw-rw-r-- 1 d13ukas vzwadmin 155365 Aug
-rw-rw-r-- 1 d13ukas vzwadmin 77765 Aug
-rw-rw-r-- 1 d13ukas vzwadmin 489210 Aug
Results of (I) are just fine.
Any ideas?
Thanks
I'm trying to use cut command to retrieve timestamp from a list of files in a certain folder. It seems that cut command mesing up with the spaces
fileTimestamp="`ls -l ${BASE_DIR}/some_dir/${fileName}`" --I
somevar="`echo $fileTimestamp | cut -c 1-40`" ---II
The results of the (II) does not preserve spaces:
-rw-rw-rw- 1 d13ukas vzwadmin 4706 Aug 1
-rw-rw-r-- 1 d13ukas vzwadmin 155365 Aug
-rw-rw-r-- 1 d13ukas vzwadmin 77765 Aug
-rw-rw-r-- 1 d13ukas vzwadmin 489210 Aug
Results of (I) are just fine.
Any ideas?
Thanks