On 23/7/24 23:22, Keith Bainbridge wrote:
Another is to fetch the epoch time value (%s) and then use that value
in all future calls. With GNU date:
now=$(date +%s)
julian=$(date -d "@$now" +%j)
dom=$(date -d "@$now" +%d)
Good evening All - especially Greg
This process has work
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
>
>
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
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 inc
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 ent
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. var
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 *less*
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 you
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 a
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
> /mn
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 $>
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
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
13 matches
Mail list logo