Guest

Untitled

By: a guest on Sep 19th, 2010  |  syntax: Bash  |  size: 0.49 KB  |  hits: 68  |  expires: Never
download  |  raw  |  embed  |  report abuse
This paste has a previous version, view the difference. Copied
  1. #!/bin/sh
  2. SPACE=`getterminfo COL`
  3. if [ $SPACE -lt 61 ]; then                      #61, weil mein Bild 60 Pixel breit ist.
  4.         echo "This looks very bad. I think your terminal is too small."
  5.         exit;
  6. fi;
  7. let COUNTPADDING=(${SPACE}-61)/2 #Hier ist jetzt unsere "Superformel"^.^ - Bzgl. 61 siehe oben ;)
  8. PADDING=`perl -e "print ' 'x${COUNTPADDING}"`; #Hier helf ich mir gerade mit Perl aus, gibt COUNTPADDING * ein Leerzeichen zurück.
  9.  
  10. #Und hier jetzt die ganzen echo's von oben.