On Wed, 04 Nov 2009 18:25:58 -0400, PJ <af.gour...@videotron.ca> wrote:
> output should be: 1  2  3 [4] 5 6 7 etc.
> is:    1 2 3 4 5 6....
> 
> the calendar.sh is exactly:
> #!/bin/sh
> cal | awk 'NR>1' | sed -e 's/   /    /g' -e 's/[^ ] /& /g' -e 's/..*/ 
> &/' -e "s/\ `date +%d`/\[`date +%d`\]/"

It's quite obviously. Let's try the last substitution
argument in plain shell:

        % date +%d
        05

But the command creates this:

         Su  Mo  Tu  We  Th  Fr  Sa
          1   2   3   4   5   6   7

The leading zero is missing, so there's no substition that
changes "5" into "[5]", because the search pattern is "05".



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to