The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Korn: How to zero fill df output so it will sort properly shew01 Shell Programming and Scripting 9 06-04-2008 07:34 AM
not getting the output properly pmrajesh21 SUN Solaris 0 04-16-2008 07:43 AM
Output in my shell isn't showing properly. satyakide Shell Programming and Scripting 7 04-01-2008 07:05 AM
lvm_queryvg call does not work properly and results in a sudden memory rise. sandiworld AIX 0 11-14-2007 09:57 PM
SSH doesnt exit properly from command line frustrated1 SUN Solaris 4 06-16-2005 01:30 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-01-2005
Registered User
 

Join Date: Nov 2005
Location: Melbourne
Posts: 4
How to output the results of the AT command - properly!

Hi,

I am new to UNIX and I am more used to simple commands like those in VMS.

One of them is the ability to get the output from a job using the /out=<file> command in VMS.

I want to submit a job (a set of unix commands) using the AT command but to get the output in a file like that used in VMS.

Now I know many of you are saying, "just redirect it using the '>' character'. I tried this and it's not producing what I expected. I don't think it's as simple as that.

For example (the qdesign command is a powerhouse (COGNOS) command, and not a unix command).

Here is my BAT file ...

#!/bin/csh

/bin/date

################################################################
# Recompile global QUICK screens, for Sydney
qdesign dict=/mis/sydmips/obj/phd.pdc << 'flag1'
use /mis/sydmips/obj/compilemips.qks nolist
exit
'flag1'


I've tried submitting this with ...

$ at -c -f compile.bat now > compile.out

I get only the line that says it submitted the command

$ echo compile.out | at -c -m now

I get an email to say that it was "run", but no standard output of the BAT file!

$ at -c -m now < compile.bat

Again I get a job number, an email to say it ran but no actual output.

How do I get actual output from the compile.bat routine, like as if I was running it online!?

Thank you
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-02-2005
Registered User
 

Join Date: Feb 2004
Location: Burgum, The Netherlands
Posts: 1
How to output the results of the AT command - properly!

I would redirect my output in the file directly (as logging) like this:

#!/bin/csh

(
/bin/date

################################################################
# Recompile global QUICK screens, for Sydney
qdesign dict=/mis/sydmips/obj/phd.pdc << 'flag1'
use /mis/sydmips/obj/compilemips.qks nolist
exit
'flag1'
) > logfile 2>&1


or just for the HERE-document:

#!/bin/csh

/bin/date

################################################################
# Recompile global QUICK screens, for Sydney
qdesign dict=/mis/sydmips/obj/phd.pdc << 'flag1' > logfile 2>&1
use /mis/sydmips/obj/compilemips.qks nolist
exit
'flag1'

Last edited by brouw005; 12-02-2005 at 05:54 AM.
Reply With Quote
  #3 (permalink)  
Old 12-04-2005
Registered User
 

Join Date: Nov 2005
Location: Melbourne
Posts: 4
No it did not work actually

I am getting "too many ('s" error now.

The other issue is that is sends the output to the MAIL box and not to the file I specified in the redirection. And this is even without the "at -m" option.

Please help!

Last edited by SpanishPassion; 12-04-2005 at 03:34 PM. Reason: Mistake in wording
Reply With Quote
  #4 (permalink)  
Old 12-04-2005
Registered User
 

Join Date: Nov 2005
Location: Melbourne
Posts: 4
Oh and the 2nd version did not work either. I got "ambiguos redirecting", which again I had to use MAIL to view the error.
Reply With Quote
  #5 (permalink)  
Old 12-04-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,284
This is more like it. I was puzzled by your response stating that it had worked. You are using csh. The redirection code brouw005 used would work in sh, ksh, or bash, but not csh. Writing scripts in csh is not wise. Since you're new to Unix, you should start with a better shell. For a list of reasons, see Csh Programming Considered Harmful. One more reason: there are very few csh experts around to help you.

I think that:
) >& logfile
might work for you. But no money back guarantees. I switched to ksh as soon as I could and I don't remember csh very well.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:53 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0