Welcome, Guest. Please login or register.

Login with username, password and session length
Pages: [1]   Go Down
Print
Author Topic: system command problems  (Read 776 times)
0 Members and 1 Guest are viewing this topic.
hjkelsheimer
Member

Posts: 28


View Profile WWW
« on: June 18, 2010, 11:44:47 PM »

i am having some trouble running the "system" command from inside my database.

from the database i have put together a command using the export process to get a new filename that is unique (see below):

i run the command in fp input processing like this:

system "cat /appl/fpmerge/q8.txt >/usr/bin/qmkfile"

the command in q8.txt looks like this:

cp /appl/fpmerge/qname.txt /home/ann/qdir/8000123.txt

this allows me to use variable new file names as needed. the new file name is generated to reflect the account number / unique identifier for that record i.e. 8000123

then

from within the database program i run this command:

system "qmkfile"

when i run the commands from # they work fine:
# qmkfile
or
# cp /appl/fpmerge/qname.txt /home/ann/qdir/8000123.txt

but from within the database processing table they don' t run and the rest of my processing fails. the interesting part is that other /usr/bin custom commands work within the same processing. they all have the same settings i.e. chmod and chown (rwxr-xr-x root root etc. qmkfile) there are many steps to get to this processing which all work but do not involve "building a unique file name". i don't have any script experience so that is a very long learning curve for me.

i have tried all kinds of ways including:

# su & sudo commands etc.

again the original commands work fine from # but not inside my processing table.

it appears that the problem is with the database -- i think??

any help you can give me or point me to would be greatly appreciated
Logged
Bill Randall
Administrator

Posts: 53


View Profile WWW
« Reply #1 on: June 19, 2010, 08:02:48 AM »

Sounds like you have done it okay but obviosly something isn't right.  I can only suggest that you create a working script maybe called '/usr/bin/testgmk'

Have this new script call your 'qmkfile' program but add some stuff to see if you get any errors or clues as to what is wrong.

set -x
qmkfile
read akey

This will echo back any errors and pause after trying to or executing qmkfile
Change your system command to execute the new script.
Logged

Bill Randall
hjkelsheimer
Member

Posts: 28


View Profile WWW
« Reply #2 on: June 19, 2010, 10:12:38 PM »

i made a new file testmkfile

set -x
cd /usr/bin
qmkfile
read akey

and i tried /usr/bin/qmkfile also in the above setup

i get nothing back just flashes by

when i run $ testmkfile it makes the file correctly. obviously it would run from # also. when i ran it from command line i get this back:

+ /usr/bin/qmkfile
+ read akey

or
+ /usr/bin
+ qmkfile
+ read akey

does this have to be run from input processing possibly?? if i can ran the command line either $ or # it doesn't seem to be a permissions thing does it??

i also made it a plain copy prc w/o the exported command line with the variable filename just to ck if it would run-- no go

i.e.
cd /appl/fpmerge
cp test8.txt test9.txt

when i am in filepro and running a system command am i "root", "user" or "filepro"?? does the command file need to be owned by "filepro" or chmod 777? or if running from root user is filepro running as root? any ideas along this line? my filepro will not run as a normal user only as root? could this be a related problem??

thanks

any ideas or suggestions??

help!
« Last Edit: June 19, 2010, 10:49:20 PM by hjkelsheimer » Logged
Bill Randall
Administrator

Posts: 53


View Profile WWW
« Reply #3 on: June 20, 2010, 03:57:55 PM »


Try a system command that shows where you are and maybe what your path is.  It sounds like you are not executing anything with the system command or you would have gotten to the read akey in your script.  Your description sounds like you are running nothing.

SYSTEM "pwd ; read akey"

This will show you where you are when you execute the command.

Do you have any SYSTEM commands that work in your processing?

You can contact support and they can log in to your machine to check things out directly for you.
Logged

Bill Randall
hjkelsheimer
Member

Posts: 28


View Profile WWW
« Reply #4 on: June 23, 2010, 08:55:28 PM »

yes, i have several system commands that run ok in the processing which is outside of this input processing @keyj which also has several system commands leading up to this one.

i will try your command w/ read akey and add a who to it so i can see who i am in the system at the time. but my question remains when running filepro processing are you the login running the processing or actually the user "filepro" ?? i don't know that it makes any difference but just question.

i have thought of another way to test it with a system command to run a menu i.e. test.-5 & put the commands inside that menu item to give me some control of whats going on etc.

in the past i have had a corrupted line in processing and deleted it and then reinput it and then it would work so i will try that also.

i won't be there to work on it til next week and will report back - good or  bad

thanks for all the help and ideas.
Logged
Pages: [1]   Go Up
Print
Jump to:  

Valid XHTML 1.0! Powered by SMF 1.1.15 | SMF © 2011, Simple Machines | Massive Blue Theme By Cadosoas Valid CSS!