Code: Select all
#!/bin/sh
colors=$(echo -e "34\n35\n36\n37"); colmatrix=($colors); r=$((RANDOM%4)); echo -e "\e[${colmatrix[$r]}m Hello World! \e[0m"
Code: Select all
#!/bin/sh
colors=$(echo -e "34\n35\n36\n37"); colmatrix=($colors); r=$((RANDOM%4)); echo -e "\e[${colmatrix[$r]}m Hello World! \e[0m"
Code: Select all
>echo;cal | grep -v [[:alpha:]] | cat -n | grep --color=always "$(date '+%d')"
Code: Select all
echo;cal | grep -v [[:alpha:]] | grep -n --color=always "$(date '+%d')" | tr ":" "\t";echo -e "\e[1A\e[1Cth wk:"
Code: Select all
echo;echo -e "\t \e[33m\e[4m`date '+%b %Y'`\e[0m";cal | grep -v [[:alpha:]] | grep -n --color=always "$(date '+%d')" | tr ":" "\t";echo -e "\e[1A\e[1Cth wk:";echo -e "\t\e[33m`cal | grep -v [[:digit:]]`\e[0m"
Hi musher0, I couldn't find 'cal' in your pet.musher0 wrote:If anyone is interested, I have made available the latest version of
coreutils, version 8-30, for PuppyLinux, here.
To anyone wondering: the link with this thread is that the GNU coreutilis
contain, among many others, three utilities used in various scripts in this
thread: cal (the full version), date and nl.
By golly, you're right, Fred.fredx181 wrote:Hi musher0, I couldn't find 'cal' in your pet.musher0 wrote:If anyone is interested, I have made available the latest version of
coreutils, version 8-30, for PuppyLinux, here.
To anyone wondering: the link with this thread is that the GNU coreutilis
contain, among many others, three utilities used in various scripts in this
thread: cal (the full version), date and nl.
On my Debian stretch system none of codes here work unless I change 'cal' to 'busybox cal' (not a problem, btw, just curious about 'cal (the full version)'.
(on my system /usr/bin/cal is symlink to /usr/bin/ncal part of package bsdmainutils)
Fred
There is more to learn from puppy_apprentice's code:musher0 wrote:Also possible for this is the use of < grep -n >, as mentioned somewhere
above by puppy_apprentice IIRC:Code: Select all
echo;cal | grep -v [[:alpha:]] | grep -n --color=always "$(date '+%d')" | tr ":" "\t";echo -e "\e[1A\e[1Cth wk:"
Thanks, the cal included works fine for me.musher0 wrote:I have compiled the latest utils-linux package, version 2.33, for
PuppyLinux. It is available through here.
Ah, ok, btw for me with LANG=en_US the week starts automatically on Sunday without the -s switch :musher0 wrote:@fredx181:
With the "real" < cal >, you have to say < cal -s > for the week to start
on Sunday.
Code: Select all
root@live:~# LANG=en_US cal # full cal
November 2018
Su Mo Tu We Th Fr Sa
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30
Hello MM.MochiMoppel wrote:Exactly which syntax are you referring to?musher0 wrote:And MM, any reason why your syntax is different than mine for
< date '+%d' >? They give the same result.
Please explain.MochiMoppel wrote:Quotes are not needed as long as the parameter contains no spaces.
Much more important is to understand the difference between date +%d and date +%-d. All your scripts will fail if you don't fix this.