Message Area
Casually read the BBS message area using an easy to use interface. Messages are categorized exactly like they are on the BBS. You may post new messages or reply to existing messages! You are not logged in. Login here for full access privileges. |
Previous Message | Next Message | Back to PRISM Chat Echo <-- <--- | Return to Home Page |
|
||||||
From | To | Subject | Date/Time | |||
Janis Kracht | Jeff Smith | Date Variable in Linux |
January 11, 2017 1:18 AM * |
|||
Hi Jeff, > I know that I can specify a DOY (Day of Year) variable in a bash > file as "DOY=$(date +%j)". But, I would only want the variable to > express the last two digits of DOY. So... 010 would be expressed as > 10 and 165 would be expressed as 65, etc. > I looking at grabbing a zipped file with a filename of filename.znn > where "nn" is the DOY minus the first digit. > Any thoughts? If I am making any sense. <g> Yes, I think I understand... Here's how I get the two-digits you are talking about when I need them in my scripts: #set variables num=`date +%j --date=Friday` pick=`expr substr $num 2 3` year=`date +%Y` echo $pick 13 echo $num 013 echo $year 2017 So I think it's the `expr substr $num 2 3` you want to use for those two digits. My variable 'list' above is looking for info for Friday's nodelist date, that's why I'm looking for --date=Friday Take care, Janis --- BBBS/Li6 v4.10 Toy-3 * Origin: Prism bbs (1:261/38) |
||||||
|
Previous Message | Next Message | Back to PRISM Chat Echo <-- <--- | Return to Home Page |
Execution Time: 0.0845 seconds If you experience any problems with this website or need help, contact the webmaster. VADV-PHP Copyright © 2002-2024 Steve Winn, Aspect Technologies. All Rights Reserved. Virtual Advanced Copyright © 1995-1997 Roland De Graaf. |