The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 10:34 AM
not getting the output properly pmrajesh21 SUN Solaris 0 04-16-2008 10:43 AM
Output in my shell isn't showing properly. satyakide Shell Programming and Scripting 7 04-01-2008 10:05 AM
lvm_queryvg call does not work properly and results in a sudden memory rise. sandiworld AIX 0 11-15-2007 01:57 AM
SSH doesnt exit properly from command line frustrated1 SUN Solaris 4 06-16-2005 04:30 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-01-2005
SpanishPassion SpanishPassion is offline
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
  #2 (permalink)  
Old 12-02-2005
brouw005 brouw005 is offline
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 09:54 AM..
  #3 (permalink)  
Old 12-04-2005
SpanishPassion SpanishPassion is offline
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 07:34 PM.. Reason: Mistake in wording
  #4 (permalink)  
Old 12-04-2005
SpanishPassion SpanishPassion is offline
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.
  #5 (permalink)  
Old 12-04-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
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.
Sponsored Links
Closed Thread

Bookmarks

Tags
unix commands

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:28 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0