Skip to main content

Executable PROC

  • May 10, 2022
  • 0 replies
  • 1 view

Peter Falson

If you're using Linux there's a trick you can use to run procs as bash scripts.

First we'll use "vi" to create our proc/script:

$ vi ~/bin/jqlsel

In vi type the following:

!!which jpq

Which should result in something like the following (on line 1)

/opt/jbase/CurrentVersion/bin/jpq

Now prefix with the bash prefix required by typing

I#!<escape>

resulting in

#!/opt/jbase/CurrentVersion/bin/jpq

Now we can proceed with our proc as normal

#!/opt/jbase/CurrentVersion/bin/jpq
PQ
H<<Enter selection command>>
p
H<<Enter command>>
P

Next make it executable

$ chmod +x jqlsel


And now we can run it like any command:


$ jqlsel

Enter selection command: SELECT mycust SAMPLE 10

Enter command: SORT mycust BY LASTNAME


------------------------------
Peter Falson
Rocket Internal - All Brands
------------------------------

​​