2017 shaares
45 private links
45 private links
3 results
tagged
Shell
Sharing a tiny bash function I'd written, to look up day for a date. Find it useful.
sd ()
{
cal -y | GREP_COLORS="mt=07;32" \grep --color=always -EC 4 " $1 |^$1 " | GREP_COLORS="sl=11;33:mt=07;33" \grep --color=always -B2 -A6 '[A-Z][a-z] '
}
@nixcraft @climagic #linux #shell https://t.co/i9zhJUMjX0
De côté aussi.
Via https://fralef.me/links/?-h3T3w
Yatta !!!
!/bin/bash
function nextIP {
for i in {"1","2","3","4"};do
eval digit$i=$(echo $1| cut -d'.' -f$i)
done
for i in {"4","3","2","1"};do
if [ $(eval echo "\${digit$i}") -lt 255 ];
then
let digit$i=$(eval echo "\${digit$i}")+1
IP="$digit1.$digit2.$digit3.$digit4"
return 0
else
let digit$i=0
fi
done
return 1
}
nextIP $1
echo $IP