in reply to Re^2: Trying to connect to MSSQL and return result. Script hangs indefinitely.
in thread Trying to connect to MSSQL and return result. Script hangs indefinitely.

My bash shell on SLES( 2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/Linux) hangs on the first code sample, waiting for the close single quote.

After one is provided, it complains (and perl does too .. the intent was to show code that appears to hang in the shell). Here is the session:

/>: perl -e 'print qx|printf "%b" "this is a q\'uot\'ed test|' > > .. Hanging here > .. until quote.. > ' -bash: .. Hanging here .. until quote.. : command not found Can't find string terminator "|" anywhere before EOF at -e line 1. />:

        Profanity is the one language all programmers know best.

  • Comment on Re^3: Trying to connect to MSSQL and return result. Script hangs indefinitely.
  • Download Code

Replies are listed 'Best First'.
Re^4: Trying to connect to MSSQL and return result. Script hangs indefinitely.
by Anonymous Monk on Aug 06, 2014 at 21:51 UTC

    Hm, same here, although it's bash that's hanging waiting for input, not Perl or the backticks, as in the OP.

    $ perl -wMstrict print qx|printf "%b" "this is a q\'uot\'ed test"|, "\n"; print qx|printf "%b" "this is a q\'uot\'ed test|; print qx|printf "%b" "this is a q\'uot'ed test|; __END__ this is a q'uot'ed test sh: Syntax error: Unterminated quoted string sh: Syntax error: Unterminated quoted string
      Ok - agreed - I cannot get bash to hang with a perl script that has backticks.

              Profanity is the one language all programmers know best.