From: Martin G. <mar...@ic...> - 2023-06-28 13:29:53
|
I don't have access to microsoft windows, but on Linux the corresponding redpsl script calls bpsl which also does not respond to --help, -h, -? and just passes whatever arguments you specify to the reduce image. redcsl --help does work. Since you are running a .bat file, did you try /help, /h or /? I also prefer running in batch and use the following script, perhaps it works for you with tweaking of paths. The script allows me to specify either psl or csl and a list of scripts, each of which is executed in a separate session and produces a transcript by appending "rlg" to the script name. If no files are specified it starts an interactive session. Regards, Martin #!/bin/sh # function to print usage note function usage { echo "usage: reduce [-h] -c|p [-o 'opt1 ... optN'] [file1 ... fileN]" echo -e "\t-h display this message and exit" echo -e "\t-c use redcsl" echo -e "\t-p use redpsl\n" echo -e "\t-o options for redcsl\n" echo -e "\tIf files are specified, they are executed in separate\n" echo -e "\tREDUCE sessions and separate output files\n" echo -e "\t(program_name.rlg) are generated." } # Handle options typeset porc="" typeset cslopt="" while getopts ":hcpo:" opt; do case $opt in h ) usage ;; c ) typeset reduce_exec="redcsl --nogui" porc=CSL;; p ) typeset reduce_exec=redpsl porc=PSL;; o ) cslopt="$OPTARG"; reduce_exec="redcsl --nogui $OPTARG" ;; \?) usage exit 1 ;; esac done shift $((OPTIND - 1)) ## if no file specified, run by default w/o gui if [ -z $1 ] ;then if [ "$porc" == "CSL" ] ;then reduce_exec="redcsl --nogui $cslopt" ; fi /usr/local/bin/$reduce_exec exit $? fi if [ -z "$reduce_exec" ] ; then usage exit 1 fi for reduce_pgm in $* ; do typeset name=${reduce_pgm%*.red} /usr/local/bin/$reduce_exec < $name.red > $name.rlg 2>&1 done On 6/28/23 11:48, Martin Vahi wrote: > > After extensive surfing at REDUCE home page, > "googling" and trying the > > C:\Program Files\Reduce\bin\redpsl.bat > > with strings like > > -? > --help > -help > -h > > I still struggle to figure out, where to get > a list of command line arguments that I can > give to REDUCE from a bat/Bash/whatever_shell > The documentation seems to be all about interactive > use of REDUCE, but I want to do > > start_reduce ./my_reducefile.txt > some_program_written_by_me < calculation_results_by_my_reducefile_txt_code.txt > > and all of that NON-interactively. A lot like > > ruby my_program.rb > python my_program.py > bash this_is_a_bash.script > reduce_or_some_wrapper_to_it ./my_reduce_code.txt > > Thank You. > > Yours sincerely, > Mar...@so... > > > _______________________________________________ > Reduce-algebra-developers mailing list > Red...@li... > https://lists.sourceforge.net/lists/listinfo/reduce-algebra-developers |