Uploaded image for project: 'Product Technical Learning'
  1. Product Technical Learning
  2. PTL-2496

RH124-735: Grading script hungs instead of failing if grep can't find any coincidence of `/opt/review5-size`in the file

XMLWordPrintable

    • en-US (English)

      URL: https://rol.redhat.com/rol/app/courses/rh124-9.0/pages/ch17s06
      Reporter RHNID: carias@redhat.com
      Section: 6 - Lab: Mount File Systems and Find Files
      Language: en-US (English)|
      Workaround: command="grep " + _comp_review5_file3 + " " + _comp_review5_txt3 + "; \ if [ $? -eq 0 ]; \
      then wc -c $(grep " + _comp_review5_file3 + " " + _comp_review5_txt3 + ") | \
      awk '

      { print $1}'; \
      else exit 1; fi",

      Description: The grading scrip waits for-ever to the wc -c command to end.





      When the word is in the file, it works fine, but if I change it for anything else, it will be hung.

       



       
      
      

      # Workaround
      command="grep " + _comp_review5_file3 + " " + _comp_review5_txt3 + "; \
      if [ $? -eq 0 ]; \
      then wc -c $(grep " + _comp_review5_file3 + " " + _comp_review5_txt3 + ") | \
      awk '{ print $1}

      '; \
      else exit 1; fi",

      
      

       

       

              glsbugs-hybridcloud@redhat.com PTL - RHEL Team
              carias@redhat.com Carlos Arias
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: