[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

sh2c ønskes



Hej,

Er der en venlig sjæl der kan oversætte dette lille shellscript til c. da
det som shellscript tager lidt rigeligt resourcer. :)

Med Venlig Hilsen Hans-Henrik Andresen


---------------------
#!/bin/bash
#
###################################################################
#                                                                 #
#      Inspil - (c) Jydsk Consulting 2001                         #
#                                                                 #
#             sslug@sslug                                      #
#                                                                 #
###################################################################

READ=1

clear
MELODI=$1
TEMPO=$2
if [ "$MELODI" = "" ] ; then
  echo
  echo "Der skal indtastes et navn !!!"
  echo
  exit 4
fi
MELODI="/tmp/klokke/$MELODI"
echo
echo
if [ $TEMPO -gt 300 ] ; then
  echo "Hastighed $TEMPO er det ikke for hurtigt ????"
  echo
  exit 4
fi
if [ $TEMPO -lt 30 ] ; then
  echo "Hastighed $TEMPO er det ikke for langomt ????"
  echo
  exit 4
fi
echo "$TEMPO" > $MELODI
echo "Indtast takt og tryk enter - skriv slut på ny linie når der ikke er
flere takter"
echo
while [ $READ -eq "1" ] ; do
  TEGNNU=0
  read LINIE
  if [ "$LINIE" = "slut" ] ; then
    READ=0
  else
    ANTALTEGN=`echo $LINIE | wc -c`
    while [ $ANTALTEGN -gt $TEGNNU ] ; do
        TEGNNU=`expr \`echo $TEGNNU\` + 1`
        NODE=`echo $LINIE | cut -c$TEGNNU`
        case "$NODE" in
          'q' )
               echo "X00000000000" >> $MELODI
               ;;
          'w' )
               echo "0X0000000000" >> $MELODI
               ;;
          'e' )
               echo "00X000000000" >> $MELODI
               ;;
          'r' )
               echo "000X00000000" >> $MELODI
               ;;
          '5' )
               echo "0000X0000000" >> $MELODI
               ;;
          't' )
               echo "00000X000000" >> $MELODI
               ;;
          'y' )
               echo "000000X00000" >> $MELODI
               ;;
          '7' )
               echo "0000000X0000" >> $MELODI
               ;;
          'u' )
               echo "00000000X000" >> $MELODI
               ;;
          'i' )
               echo "000000000X00" >> $MELODI
               ;;
          'o' )
               echo "0000000000X0" >> $MELODI
               ;;
          'p' )
               echo "00000000000X" >> $MELODI
               ;;
          '.' )
               echo "000000000000" >> $MELODI
               ;;
        esac
    done
  fi
done






 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *