The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
NAWK Script not working fine dheeraj19584 Shell Programming and Scripting 3 06-12-2008 04:36 AM
Script runs fine on UNIX Server...Not through MSK Tool kit on Windows Server madhunk UNIX for Dummies Questions & Answers 5 01-31-2008 10:30 AM
perl - how come this script works? mjays Shell Programming and Scripting 3 09-17-2007 07:50 AM
Infinite Loop in Autosys while running a shell script, Manual run is fine sharmagaurav_2k Shell Programming and Scripting 2 09-04-2007 05:20 AM
works from cmd-line but not in script OFFSIHR Shell Programming and Scripting 4 10-18-2006 05:41 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-06-2006
Registered User
 

Join Date: Jan 2006
Location: Virginia Beach, VA
Posts: 1
Script works fine until I | more

Hello all,

This beats me. I have a script that executes some commands and redirects their output to some text files that I will parse. The commands are along the lines of:

dsmadmc -id=admin -pa=admin -outfile=/home/tools/qlog.txt q log f=d

If I just run the script it works. If I execute it from the command line, the output looks like this:

[root@portdat:/home/tools] cat qlog.txt
Tivoli Storage Manager
Command Line Administrative Interface - Version 5, Release 1, Level 7.5
(C) Copyright IBM Corporation 1990, 2004 All Rights Reserved.

ANS8000I Server command: 'q log f=d'

Available Space (MB): 10,340
Assigned Capacity (MB): 10,296
Maximum Extension (MB): 44
Maximum Reduction (MB): 10,188
Page Size (bytes): 4,096
Total Usable Pages: 2,635,264
Used Pages: 25,964
Pct Util: 1.0
Max. Pct Util: 81.1
Physical Volumes: 8
Log Pool Pages: 128
Log Pool Pct. Util: 0.61
Log Pool Pct. Wait: 0.00
Cumulative Consumption (MB): 520,162.29
Consumption Reset Date/Time: 09/01/03 14:25:25


ANS8002I Highest return code was 0.

If I | more it, the output looks like this:

[root@portdat:/home/tools] cat qlog.txt
Tivoli Storage Manager
Command Line Administrative Interface - Version 5, Release 1, Level 7.5
(C) Copyright IBM Corporation 1990, 2004 All Rights Reserved.

ANS8000I Server command: 'q log f=d'

Available Assigned Maximum Maximum Page Total
Used Pct Max. Physical Log Log Log
Cumulative Consumption
Space Capacity Extension Reduction Size Usable
Pages Util Pct Volumes Pool Pool Pool
Consumption Reset
(MB) (MB) (MB) (MB) (bytes) Pages
Util Pages Pct. Pct.
(MB) Date/Time

Util Wait

--------- -------- --------- --------- ------- ---------
--------- ----- ----- -------- ------ ------ ------
----------- -----------
10,340 10,296 44 10,188 4,096 2,635,264
25,995 1.0 81.1 8 128 0.61 0.00
520,162.41 09/01/03


14:25:25

ANS8002I Highest return code was 0.

This is not even the command. It looks like two things are happening: the format is being screwed up somehow, and the f=d option is not being executed. Any ideas?

This is on AIX 5.2 using the ksh.

Thanks for any input,

Michael
Reply With Quote
Forum Sponsor
  #2  
Old 01-11-2006
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
First off, your second example (where you state you are using | more ) - shows the command cat qlog.txt - so I must assume you were using the | more on the end of dsmadmc -id=admin -pa=admin -outfile=/home/tools/qlog.txt q log f=d I don't understand why since you are setting an output file.

(No, I'm not an AIX sa and don't have access to AIX - just going on instinct )
Reply With Quote
  #3  
Old 01-11-2006
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
The ls program will do stuff like this on most systems. Maybe AIX is an exception. But for me, "ls" and "ls | more" give different results. I am forced to do a "ls -C | more" to see the equivalent of "ls'. What is happening is that the ls program is looking at stdout and checking to see if it's a tty or not. If it is a tty, it defaults to -C. Any program can do that, but to do so is controversial to say the least. All I can suggest is to check the man page for your command and see if there is an option to give you the result you want. Possibly the program is innocent and it's the script that is doing this. To see the syntax, try these commands from a ksh prompt:
{ [ -t 1 ] && echo yes; }
{ [ -t 1 ] && echo yes; } | cat

The first should print "yes" but the second should print nothing. Check your script for stuff like that.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:47 AM.


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

Content Relevant URLs by vBSEO 3.2.0