Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2008
    Posts
    464

    Unanswered: understanding a bit of code in spanish

    Hi

    I admit I'm a complete novice in Informix programming and apologize for any incomplete or stupid questions but I have a task to understand how the file that is created below gets the datetime portion of it's name.

    Code:
    endtime=$ano-$mes-$dia" "$hora":"$minuto
    echo "endtime is $endtime"
    ftime=$ano$mes$dia$hora$minuto  #ftime = $ year $ month $ day $ hour $ minute
    echo "ftime is $ftime"
    #
    # Compruebo cuantos reports hay - I note there are few reports
    #
    reports=`ls $1/*.act | sed -e "s/\.act//"`
    if test -n "$reports"
    then
       # Para cada report ejecuto su sentencia SQL - For each report run your SQL statement
       for rep in $reports
       do
    
          # Create Output file per each Measurement per hour ( Antoine EGHO )
          #
          basename $rep
          datafile=$2/`basename $rep`.$ftime.csv
          rm -f $datafile
          touch $datafile
    Any chance someone could lend me their expertise?

    Regards
    Shajju

  2. #2
    Join Date
    Sep 2011
    Location
    Pont l'Abbé, Brittany, France
    Posts
    381
    Provided Answers: 1
    Hi,

    this is pure unix korn or bourne shell that is handling Informix reports files (.act)
    this is the only thing that talks about Informix in the piece of code you passed.

    the datetime portion of the filename comes from the $ano, $mes, $dia shell variables, but nothing in your piece of code tells how they get a value...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •