riccardinofuffolo

Sistemi Operativi - 16/07/2007 A - Es. 6

Aug 15th, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.34 KB | None | 0 0
  1. #!/bin/bash
  2. # echo $2
  3. linea_giorni=$(cal $2 $3 | sed -n '2p')
  4. indice=$(cal $2 $3 | grep -w $1 | awk -v giorno=$1 '{
  5.     indice = giorno - $1 + 1
  6.     printf("%d", indice)
  7. }')
  8. posizione=$(( $indice * 2 + $indice - 3))   # Rivedere ma comunque giusto
  9. echo $posizione
  10. echo ${linea_giorni:$posizione:2}   # In questo comando la prima lettera ha indice 0
Advertisement
Add Comment
Please, Sign In to add comment