| 
      
      
      From: David E. <de...@us...> - 2005-05-19 19:48:28
      
     | 
| Burke Cabaniss wrote: > Burke Cabaniss asks: > > In a RedHat Linux environment I need to CALL bash and > pass the commands it will execute; Linux programs and > other scripts. > With my current COBOL, this is > CALL 'SYSTEM' USING [ dataname | literal ] . > I would guess this might be done by a "canned" C executable, > but am not a C programmer. I am a COBOL programmer in many > environments for 40 years. > `bash` capabilities greatly expand what I could do in previous > environments. > > My COBOL has other useful CALL "canned" modules, such as one to return > (pass) the string value of a bash environment variable, and the number > and length of the USING parameters passed to a called COBOL program. > Note that bash itself returns only an integer, if I understand. > > I do not find any of this treated in TC or other COBOL documentation. > Please advise me about it. Yes you can call basically call any program or library function. Example: 01 VAR1. 05 FILLER X(15) VALUE 'ls -l some-dir' 05 FILLER X(01) VALUE x'00' ... CALL 'system' USING VAR1. Note that 'system' is C library call, and like any C string should be null terminated. Hope this helps. |