SHELL Scripts



Not sure where to post this...but I am having some trouble with a Shell Script.

I am getting an error when I use the CALL command in the shell script.
While the doc and the CALL /? doc both show that a CALL :Label arguments is a
valid way of using the function, I can't seem to get it to work.

In a generic script I can make it work with something simepl like this:
Using it at the command prompt like MYTEST.BAT input text here, results in an
echo of the text inputed.

@ECHO OFF
SET ISSUED=%1
CALL :TEST %ISSUED%

GOTO :EOF

:TEST
echo hello %1
pause

:EOF

HOWEVER if I have something a little more complex: Like below, I get a Bad
Command or Filename when using the CALL function of the Shell. Any ideas why
this happening? (I over simplified the script to remove the excess fluff, and
added the debug string that I wanted to display to know where I am at
execution)...

Thanks
J


@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION

REM - - - - U_CRS.BAT - - - -

CLS


IF "%1"=="1" goto ONE
IF "%1"=="2" goto TWO

GOTO EOF

:ONE
SET ISSUED="C:\PATH\PATHLOC\IN\ISSUED.DAT"
SET RAWFILE="C:\PATH\PATHLOC\IN\ISSUED.DAT"
SET BLOCK="NORMAL_BLOCK_50"

GOTO PROCESS

:TWO

SET ISSUED="C:\PATH\PATHLOC\IN\OUTPUT.DAT"
SET RAWFILE="C:\PATH\PATHLOC\IN\SEMC??????.ISSUED"
SET BLOCK="NORMAL_BLOCK_50"

GOTO PROCESS
:PROCESS

CALL :TEST %ISSUED%

echo after called test
pause

GOTO EOF

REM
******************************************************************************
REM *** FUNCTIONS
***
REM
******************************************************************************

:TEST
echo hello
echo %1
pause

:EOF
endlocal
EXIT


.



Relevant Pages

  • Re: Sed replace doesnt work from shell script
    ... but it appears that google doesn't echo a group for sed. ... > This works fine from the command line. ... > a shell script, i get: ...
    (comp.lang.awk)
  • Re: Sed replace doesnt work from shell script
    ... but it appears that google doesn't echo a group for sed. ... > This works fine from the command line. ... > a shell script, i get: ...
    (comp.unix.shell)
  • Sed replace doesnt work from shell script
    ... but it appears that google doesn't echo a group for sed. ... This works fine from the command line. ... a shell script, i get: ...
    (comp.lang.awk)
  • Basic Shell script question
    ... I have Solaris 9 installed and using a simple shell script. ... The second echo does not print, the cd command fails and quits the ...
    (comp.unix.solaris)
  • Re: Persisting env vars in cmd windows
    ... more about batch files as you go on, ... echo The time is %time::=.% ... But the piece de resistance was the "start" command, ... echo:: ERROR ERROR ERROR ERROR ...
    (microsoft.public.win2000.general)