Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-4724

Syntax error in wtperf_ckpt.sh when running 'dash' as default shell

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT3.2.0, 4.1.11
    • Affects Version/s: None
    • Component/s: None
    • None
    • 2
    • Storage Engines 2019-04-22

      Job wiredtiger-test-check-long started to fail recently since running on the new Jenkins machines (Ubuntu 18.04 LTS). [[ is a valid 'bash' syntax while not recognised by 'dash' - the default 'sh' on Ubuntu OS. 

      http://build.wiredtiger.com:8080/job/wiredtiger-test-check-long/1103/

      + chmod a+x ../../../bench/wtperf/runners/wtperf_ckpt.sh ../../../bench/wtperf/runners/wtperf_run.sh ../../../bench/wtperf/runners/wtperf_track.sh
      + echo 'Run truncate btree job (mongodb oplog)'
      Run truncate btree job (mongodb oplog)
      + ../../../bench/wtperf/runners/wtperf_run.sh ../../../bench/wtperf/runners/mongodb-oplog.wtperf 1
      ../../../bench/wtperf/runners/wtperf_run.sh: 27: ../../../bench/wtperf/runners/wtperf_run.sh: [[: not found
      ../../../bench/wtperf/runners/wtperf_run.sh: 42: ../../../bench/wtperf/runners/wtperf_run.sh: Syntax error: "(" unexpected
      + cleanup
      + status=2 

      The code segment that had the syntax error:

      while [[ $# -gt 0 ]] ; do
              if test "$1" == "NOCREATE"; then
                      create=0
              else
                      wtarg+=" $1"
              fi
              shift # Consume this arg
      done 

      We could either fix the while loop line to be compatible with 'dash', or specify 'bash' on the shebang line.

            Assignee:
            sue.loverso@mongodb.com Susan LoVerso
            Reporter:
            luke.chen@mongodb.com Luke Chen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: