![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#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 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
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 |
|
#3
|
||||
|
||||
|
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. |
||||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|