I am trying to avoid using tar.

Let me simplify as I am trying to work with just one file now.

I tried this command;

gzip -9 -r -q test001.zip /path

Where /path is the directory I want to zip all files in and I want to have as output test001.zip, which unix complains that test001.zip does not exist, which I don't understand as I am trying to create this.

Am I misunderstanding the arguments?

I'm having trouble getting the shell script get the output, which will be multiple lines, into a file.

Right now I have this

NAMESPACE='XXXXX'
irissession XXXXX <<EOM
znspace="${NAMESPACE}"
set mysqlstat="select * from file.Log where ConfigName='hhhhhhhhhhh"
set sr=##class(%SQL.Statement).%ExecDirect(,mysqlstat) if sr.%SQLCODE=0 do sr.%Display()
halt
EOM

This works great to get output to a screen. I tried the statements from your last reply but still get screen output, nothing to the file, and an occasional objection to my syntax. I have a lot of experience with the shell scripting but the SQL and objectscript are relatively new. It's getting the output into a flat file that is the missing link for me. Once there, I can parse, search, and format output all day.

This solved my first issue, getting the data from a script. I want to get it into a file. My last set statement outputs using variable.%Display(). I've been searching the documentation but haven't found how to write output to a text file. It seems like I can't find the command for it, which I think would look like variable.%OutputCommand(file path).

Let me step back and work with just the two prompts that don't seem to play well together.
I run the irissession SERVER command and there I can use the set statements, one using a set and the other calling a class. This output comes to the screen. I cannot run these if I don't run the irissession command. I can't run unix commands like grep or output to a file if I do.

I'd like to be able to have a script that gets access to this data and then gets out. My script can run the irissession command but after that nothing in the script gets accessed.