Jul 16, 2009 #1 prosper Programmer Sep 4, 2001 631 HK Code: mytime=$(date +%Y%m%d_%k%M%S) dname="suse" networkDir="network" outputname=$mytime"_"$dname"_"$networkDir.tar.gz I sometimes got network.tar.gz from outputname. Does my script have any problem? Thanks for any help
Code: mytime=$(date +%Y%m%d_%k%M%S) dname="suse" networkDir="network" outputname=$mytime"_"$dname"_"$networkDir.tar.gz I sometimes got network.tar.gz from outputname. Does my script have any problem? Thanks for any help
Jul 16, 2009 Thread starter #2 prosper Programmer Sep 4, 2001 631 HK my program is a bash script Upvote 0 Downvote
Jul 16, 2009 2 #3 Annihilannic MIS Jun 22, 2000 6,317 AU I think you want %H instead of %k. %k can have a space in it before midday. Also I would recommend this syntax: Code: outputname="${mytime}_${dname}_${networkDir}.tar.gz" Annihilannic. Upvote 0 Downvote
I think you want %H instead of %k. %k can have a space in it before midday. Also I would recommend this syntax: Code: outputname="${mytime}_${dname}_${networkDir}.tar.gz" Annihilannic.