01-06-2006
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
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a very basic script that essentially sends a log file, via FTP, to a backup server. My cron entry to run this every night is:
55 23 * * * /usr/bin/archive_logs
The script runs perfectly when executed manually, and actually worked via cron for about three weeks. However, it mysteriously... (3 Replies)
Discussion started by: cdunavent
3 Replies
2. Shell Programming and Scripting
Hi,
A cron job CJ invokes a shell script SC. SC internally invokes multiple perl scripts. One of the perl scripts deals with Accurev (i am using Accurev CLI).
The first accurev command encountered is
accurev merge -i <<file_name>> (file name has absolute path)
When I run the perl script or... (1 Reply)
Discussion started by: singh
1 Replies
3. UNIX for Advanced & Expert Users
I am having trouble mounting with cifs, but mounting the exact same command with smbfs works fine. The share is on another samba server and is set to full public guest access. # mount -t cifs //servername/sharename /mnt/temp -o password=""
mount error 13 = Permission denied Refer to the... (3 Replies)
Discussion started by: humbletech99
3 Replies
4. UNIX for Dummies Questions & Answers
1)
ssh a@b
echo $USER it display the correct value as a (even though i have not defined it in .profile)
2)
remsh b -l a
echo $USER it does not display the value as a (variable is not set
any idea why $USER variable is not initialized when i login via remsh or rlogin but shows the... (10 Replies)
Discussion started by: reldb
10 Replies
5. Shell Programming and Scripting
Hello All,
This is driving me nuts. Wrote a very simple script (it's in csh so sorry about that). Just something very simple though. Here is the catch. Works great from command line sometimes. Other times it runs no errors or anything but I never receive an email. Never runs from crontab... (6 Replies)
Discussion started by: jacktay
6 Replies
6. Shell Programming and Scripting
Hi,
I have a problem with a SED script that works fine on AIX but does not work properly on a Solaris system.
The ksh script executes the SED and puts the output in HTML in tables.
But the layout of the output in HTML is not shown correctly(no tables, no color). Can anyone tell if there is... (7 Replies)
Discussion started by: Faith111
7 Replies
7. Shell Programming and Scripting
Guys,
I need you help please.
The script below is not working correclty for checking via a awk/if statement . Can you tell me what i am doing wrong in the script code "if($1 == "$RETENTION_LEVEL") "
Syntax
RETENTION_LEVEL=`echo $LINE | cut -f2 -d" "`
echo " ==============... (4 Replies)
Discussion started by: Junes
4 Replies
8. UNIX for Dummies Questions & Answers
Greetings, I have a C-program that is made to implement a hidden Markov model on an input file. The program is very memory intensive.
I've installed it on my local server where I have an account and it compiles fine. The way they have the server set up is that you can either work... (1 Reply)
Discussion started by: Twinklefingers
1 Replies
9. Shell Programming and Scripting
Hi,
I am a bit confused ,why would a sed command work fine outside of ksh script but not inside.
e.g
I want to replace all the characters which end with a value and have space at end of it.
so my command for it is :
sed -i "s/$SEPARATOR /$SEPARATOR/g" file_name
This is working fine in... (8 Replies)
Discussion started by: vital_parsley
8 Replies
10. Shell Programming and Scripting
Hello all,
I am facing a weird issue while executing a code below -
#!/bin/bash
cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset
sh UKBA_publish.sh UKBA 28082015 3
if
then
echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
Discussion started by: ektubbe
2 Replies
LEARN ABOUT OSX
apache2::util
apache_mod_perl-108~358::mod_perl-2.0.7::docs::api::ApacUser:Contributed Perl apache_mod_perl-108~358::mod_perl-2.0.7::docs::api::Apache2::Util(3)
NAME
Apache2::Util - Perl API for Misc Apache Utility functions
Synopsis
use Apache2::Util ();
# OS escape path
$escaped_path = Apache2::Util::escape_path($path, "a 'long' file.html");
# format time as a string
my $fmt = "%a, %D %H:%M:%S %Z";
$fmtdate = Apache2::Util::ht_time($r->pool, $r->request_time, $fmt, 0);
Description
Various Apache utilities that don't fit into any other group.
Functions API
"Apache2::Util" provides the following functions and/or methods:
"escape_path"
convert an OS path to a URL in an OS dependant way.
$escaped_path = Apache2::Util::escape_path($path, $p);
$escaped_path = Apache2::Util::escape_path($path, $p, $partial);
arg1: $path ( string )
The path to convert
arg2: $p ( "APR::Pool" )
The pool to allocate from
opt arg3: $partial ( boolean )
if TRUE, assume that the path will be appended to something with a '/' in it (and thus does not prefix "./")
if FALSE it prepends "./" unless $path contains ":" optionally followed by "/".
the default is TRUE
ret: $escaped_path ( string )
The escaped path
since: 2.0.00
"ht_time"
Convert time from an integer value into a string in a specified format
$time_str = Apache2::Util::ht_time($p);
$time_str = Apache2::Util::ht_time($p, $time);
$time_str = Apache2::Util::ht_time($p, $time, $fmt);
$time_str = Apache2::Util::ht_time($p, $time, $fmt, $gmt);
arg1: $p ( "APR::Pool object" )
The pool to allocate memory from
opt arg2: $time ( number )
The time to convert (e.g., "time()" or "$r->request_time").
If the value is not passed the current time will be used.
opt arg3: $fmt ( string )
The format to use for the conversion, using strftime(3) tokens.
If the value is not passed the default format used is:
"%a, %d %b %Y %H:%M:%S %Z"
opt arg4: $gmt ( boolean )
The time will be not converted to GMT if FALSE is passed.
If the value is not passed TRUE (do convert) is used as a default.
ret: $time_str (string)
The string that represents the specified time
since: 2.0.00
Examples:
Use current time, the default format and convert to GMT:
$fmtdate = Apache2::Util::ht_time($r->pool);
Use my time, the default format and convert to GMT:
my $time = time+100;
$fmtdate = Apache2::Util::ht_time($r->pool, $time);
Use the time the request has started, custom format and don't convert to GMT:
my $fmt = "%a, %D %H:%M:%S %Z";
$fmtdate = Apache2::Util::ht_time($r->pool, $r->request_time, $fmt, 0);
See Also
mod_perl 2.0 documentation.
Copyright
mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0.
Authors
The mod_perl development team and numerous contributors.
perl v5.16.2 2011-02-07apache_mod_perl-108~358::mod_perl-2.0.7::docs::api::Apache2::Util(3)