Commands with colons

Issue #20 resolved
Aaron Bartell created an issue

Ran into an issue today where a 5250 command within the :system section of a xxxx.lst file had a colon (:) in it. The wildcard in the case statement caused the command to not be processed because it thought it was a "action".

Below is a snippet from chroot_setup.sh with the offending case pattern pointed out (*:*).

function chroot_setup {  
  # copy needed PASE binaries
  action=""
  while read -r name <&3; do
    case "$name" in
      "")
        # echo "empty"
      ;;
      *#*)
        # echo "comment"
      ;;
      *:*)   <----------------------
        # echo "action"
        action=$name
      ;;
      *)

I propose we only search for the colon in the first space of a line by changing to the following:

function chroot_setup {  
  # copy needed PASE binaries
  action=""
  while read -r name <&3; do
    case "$name" in
      "")
        # echo "empty"
      ;;
      *#*)
        # echo "comment"
      ;;
      :*)    <-------------------------------------
        # echo "action"
        action=$name
      ;;
      *)

I tested this on a complex chroot creation and it is working as expected.

##Do you see any issues with making this change?

Comments (2)

  1. Log in to comment