angshuman_ag, you might want to actually lay out the entire script, including the shebang for us to assist further. This is at least your second thread on this topic, all of which seem to meander back to befuddled.
While we'd like to assist, without more than 'no work' responses, we cannot assist on conjecture. What is your script? What are the args? What is the output to screen...or the return code you're seeing?
I have already laid out the entire script. Its a custom 3rd party tool which return a string always to the console in case of error or success. So, I want to capture that string output in a variable so that I can log that string for debugging purpose. That is the only requirement. If I had the source code of that tool, I could have figured out myself. But, since I have only this much information, hence I thought of posting in this forum.
OK, you now have provided us with another bit of very valuable information. What console is it returning the error to? What system is this on? Is it a GUI or a command line executable?
I don't see a script...although I do see individual command-line calls. Perhaps you're confusing the notion of a script? What shell is it this time? Is it still csh? Previous thread was focused on ksh application of the approach.
If it's on Solaris, have you polled the /var/adm/messages file to see if it's already outputting to a system log?
Hi,
As I have previously said, its a C SHELL on Solaris 8. And, again I will post the "myScript". It looks like this after your suggestion-
set output=`/usr/bin/convert -f inputfile.xcf`
echo "test:\n$output"
Still the above code outputs everything to the console UNIX window when I execute the script like this ./myScript. It echoes its own success/error string in the 1st line on the window followed by "test:" and a BLANK newline. So, the output variable does not have anything yet.
(It does not outputs anyting to system logs). I want to capture the part of string which it echoes before "test:" inside a variable.
does this 'convert' program provide either a --help (or -h) option, a man page or any sort of usage? does it maintain it's own logging, if it's part of a larger application? are we talking Gimp picture files...?
Hi,
These are custom files which have their own format. There is no problem with the conversion or the tool. Its working fine. The only problem is storing its output string.
The help which it provides is very minimal. There are only two options , one which I have provided and other one is -outdir which will put the converted file to the mentioned folder (if provided). There is no man page entry too. Also, it does not maintains any logs. Whatever is there it outputs to the console window. Same output I want to capture.
If I give a bogus option flag like you said, it ignores the option and does the conversion successfully. It just requires the input filename. If provided with other flag like -f or -outdir, it will use them else will ignore other flags.
So, the bogus option flag is ignored and no usage mesages are seen.
Well I'll leave it to you from here. I find you seem to expect a lot of inferences on our part based on what you've shown so far. I don't see anything explicitly worded to support your 'Like I said' comment, but maybe you're assuming a mind meld is underway...it's not.
My only recommendation would be to adopt a better sense of documenting the issue while you take it up with the Vendor. Good luck.