Re: How to update environment variable output

2024-07-24 Thread Greg Wooledge
On Wed, Jul 24, 2024 at 21:08:29 +1000, Keith Bainbridge wrote: > So when I opened my xterm this morning, I saw: >  keith@lenv0 > >  Tue 23Jul2024@19:19:30 205.2024 AEST >  :~   $> > > You have new mail in /var/spool/mail/keith > > > Pressed enter, and the day# updated: > >  keith@lenv0 > >  

Re: How to update environment variable output

2024-07-24 Thread Keith Bainbridge
On 23/7/24 23:22, Keith Bainbridge wrote: On 23 July 2024 9:42:27 pm AEST, Greg Wooledge wrote: On Tue, Jul 23, 2024 at 18:02:53 +1000, Keith Bainbridge wrote: From the tab I had used earlier, ran source .bashrc then :/tmp/205.2024 $>mkcd /tmp/day$DOYR.$YEAR So you're setting

Re: How to update environment variable output

2024-07-23 Thread David Wright
On Tue 23 Jul 2024 at 15:00:12 (-0400), Greg Wooledge wrote: > On Tue, Jul 23, 2024 at 13:38:48 -0500, David Wright wrote: > > On Tue 23 Jul 2024 at 09:31:36 (-0400), Greg Wooledge wrote: > > > On Tue, Jul 23, 2024 at 23:22:52 +1000, Keith Bainbridge wrote: > > > > The day# in my command prompt

Re: How to update environment variable output

2024-07-23 Thread Greg Wooledge
On Tue, Jul 23, 2024 at 13:38:48 -0500, David Wright wrote: > On Tue 23 Jul 2024 at 09:31:36 (-0400), Greg Wooledge wrote: > > On Tue, Jul 23, 2024 at 23:22:52 +1000, Keith Bainbridge wrote: > > > The day# in my command prompt increments when I start in the morning. > > > Maybe I need to press

Re: How to update environment variable output

2024-07-23 Thread David Wright
On Tue 23 Jul 2024 at 09:31:36 (-0400), Greg Wooledge wrote: > On Tue, Jul 23, 2024 at 23:22:52 +1000, Keith Bainbridge wrote: > > The day# in my command prompt increments when I start in the morning. Maybe > > I need to press enter. > > That makes it sound like you're setting the YEAR et al.

Re: How to update environment variable output

2024-07-23 Thread Greg Wooledge
On Tue, Jul 23, 2024 at 23:22:52 +1000, Keith Bainbridge wrote: > The day# in my command prompt increments when I start in the morning. Maybe I > need to press enter. That makes it sound like you're setting the YEAR et al. variables in the PROMPT_COMMAND variable. If that's the case, it's

Re: How to update environment variable output

2024-07-23 Thread Keith Bainbridge
On 23 July 2024 9:42:27 pm AEST, Greg Wooledge wrote: >On Tue, Jul 23, 2024 at 18:02:53 +1000, Keith Bainbridge wrote: >> From the tab I had used earlier, ran source .bashrc >> >> then >> :/tmp/205.2024 $>mkcd /tmp/day$DOYR.$YEAR > >So you're setting those variables one time inside

Re: How to update environment variable output

2024-07-23 Thread Greg Wooledge
On Tue, Jul 23, 2024 at 18:02:53 +1000, Keith Bainbridge wrote: > From the tab I had used earlier, ran source .bashrc > > then > :/tmp/205.2024 $>mkcd /tmp/day$DOYR.$YEAR So you're setting those variables one time inside your .bashrc file? This is quite bad. What happens when you have

Re: How to update environment variable output

2024-07-23 Thread Greg Wooledge
On Tue, Jul 23, 2024 at 17:02:08 +1000, Keith Bainbridge wrote: > mkcd () > { > mkdir -p $1 > cd $1 > } You're missing quotes. Two sets. You probably also want && between the two commands, to check for the success of the mkdir before attempting a cd. > in the form :~ $> mkcd >

How to update environment variable output

2024-07-23 Thread Keith Bainbridge
Addendum 2 adding the full path to .bashrc failed So I tried opening a new xterm tab and ran Tue 23Jul2024@17:07:43 205.2024 AEST :~ $> mkcd /tmp/$DOYR.$YEAR and landed in /tmp/205.2024 $> Looking good From the tab I had used earlier, ran source .bashrc then :/tmp/205.2024 $>

How to update environment variable output

2024-07-23 Thread Keith Bainbridge
Addendum So I tried opening a new xterm tab and ran Tue 23Jul2024@17:07:43 205.2024 AEST :~ $> mkcd /tmp/$DOYR.$YEAR and landed in /tmp/205.2024 $> Looking good From the tab I had used earlier, ran source .bashrc then :/tmp/205.2024 $>mkcd /tmp/day$DOYR.$YEAR and landed in

How to update environment variable output

2024-07-23 Thread Keith Bainbridge
Good afternoon All For reference, today is Tue 23Jul2024@15:41:47 205.2024 AEST This is part of my command prompt, generated by PS1='\n \u@\h \n\n $(date +"%a %d%b%Y@%H:%M:%S %j.%Y %Z") \n :\w $> ' My calculation is that today is day 205 When I run this function mkcd () { mkdir -p