[foxboro] AW: Shell script problem datetimestamp of a file
- From: "D.Weinbrenner" <dweinbrenner@xxxxxxxxxx>
- To: <foxboro@xxxxxxxxxxxxx>
- Date: Fri, 15 Dec 2006 22:54:48 -0000
Try something like:
FILENAME=3D"sh_histo"
MONTH=3D$(ls -la ${FILENAME} | tr -s " " ";" | cut -f6 -d";")
if [ ${MONTH} =3D=3D "Jan" ]
then
echo "1"
elif [ ${MONTH} =3D=3D "Feb" ]
then
echo "2"
elif [ ${MONTH} =3D=3D "Dec" ]
then
echo "12"
fi
Best Regards,
------------------------
Daniel Weinbrenner
Process Automation and=20
Software Development
=20
Erpicon software development GmbH
Neusser Str. 724- 726
50733 K=F6ln =B7 Germany
Tel: +49 (0)221 97460 - 65
Fax: +49 (0)221 97460 =96 99
=20
e-mail: dweinbrenner@xxxxxxxxxx
Internet: www.erpicon.de
=20
-----Urspr=FCngliche Nachricht-----
Von: foxboro-bounce@xxxxxxxxxxxxx [mailto:foxboro-bounce@xxxxxxxxxxxxx] =
Im
Auftrag von Weiss, Andreas
Gesendet: Friday, December 15, 2006 9:41 AM
An: foxboro@xxxxxxxxxxxxx
Betreff: [foxboro] Shell script problem datetimestamp of a file
Hi List,
how is it possible to retrieve the datetime stamp (year month day hour
minute) of a file within a shell script?
The "ls -l" command provides that kind of information in different ways
but never complete. Instead of getting the english title for the month
do I need the 2 digits.
# ls -l
-rw-r--r-- 1 root other 633 Mar 12 2006
a_file_with_date_only
-r--r--r-- 1 root sys 7728 Dec 11 09:06
a_file_without_the_year
#
Regards,
Andreas
=20
=20
_______________________________________________________________________
This mailing list is neither sponsored nor endorsed by Invensys Process
Systems (formerly The Foxboro Company). Use the info you obtain here at
your own risks. Read http://www.thecassandraproject.org/disclaimer.html
=20
foxboro mailing list: http://www.freelists.org/list/foxboro
to subscribe: =
mailto:foxboro-request@xxxxxxxxxxxxx?subject=3Djoin
to unsubscribe: =
mailto:foxboro-request@xxxxxxxxxxxxx?subject=3Dleave
=20
_______________________________________________________________________
This mailing list is neither sponsored nor endorsed by Invensys Process
Systems (formerly The Foxboro Company). Use the info you obtain here at
your own risks. Read http://www.thecassandraproject.org/disclaimer.html
foxboro mailing list: http://www.freelists.org/list/foxboro
to subscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
to unsubscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
- References:
- [foxboro] Shell script problem datetimestamp of a file
- From: Weiss, Andreas
Other related posts:
- » [foxboro] AW: Shell script problem datetimestamp of a file
- [foxboro] Shell script problem datetimestamp of a file
- From: Weiss, Andreas