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
   Networked Database  PRISM Chat Echo   [49 / 54] RSS
 From   To   Subject   Date/Time 
Message   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)
  Show ANSI Codes | Hide BBCodes | Show Color Codes | Hide Encoding | Hide HTML Tags | Show Routing
Previous Message | Next Message | Back to PRISM Chat Echo  <--  <--- Return to Home Page

VADV-PHP
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.
v2.0.140505

Warning: Unknown: open(c:\Sessions\sess_mper44isp1he31rtu3qh69rm83, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (c:\Sessions) in Unknown on line 0 PHP Warning: session_start(): open(c:\Sessions\sess_mper44isp1he31rtu3qh69rm83, O_RDWR) failed: No such file or directory (2) in D:\wc5\http\public\VADV\include\common.inc.php on line 45 PHP Warning: Unknown: open(c:\Sessions\sess_mper44isp1he31rtu3qh69rm83, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (c:\Sessions) in Unknown on line 0