Steve
I'm an idiot - your suggestion above does of course work.....my testing was flawed.... :)
I stupidly put the following when testing. Doh!
qx{cp $fileA $fileA.bak > 2>&1};
and not of course:
qx{cp $fileA $fileA.bak 2>&1};
Thanks!
Works perfectly well now!
Many thanks for the response, Steve.
I had actually already tried that one and sadly it doesn't work either. The error message still gets displayed and worse the error code returned is 0.
So - many thanks anyway but still stumped so far :)
Hi All
The issue above is actually causing me more hassle than I first thought. It looks like when I do the following:
$logger->info("calling sub extCmd");
my @return = extCmd(some args here);
my $rc = pop(@return);
if ($rc != 0){
$logger->error("script called in sub extCmd...
Hi all
I managed to get the return code back to the call script and can now verify the return code and then set logging accordingly. See below:
sub extCmd {
# some code here
# some more here
my @output = qx{some command here};
my $exval = $?;
push (@output, $exval);
return...
Hi Kevin
Many thanks for the response. I have read the links you posted (in fact, the second was my intro to log4perl :). I think I'm fairly comfortable with what log4perl can do in terms of log levels, appenders, logger initialisation, re-reading etc.
Perhaps I misunderstood something or...
Hi Steve!
Many thanks for the tip. It's not 100% what I was looking for for but definitely a step in the right direction and will certainly work for me - so thanks! I was hoping to find a realtime solution, I guess with this one you have to wait until the external call completes before logging...
Hi All
I recently started investigating using log4perl - which is great! I, rather disappointingly, also discovered that the majority of output that I generate from my scripts comes from either system calls or running of external code (e.g. java).
Is there any way I can get the output from...
Hi All
Aplogies in advance for a dumb question.
I'm trying to read in a file format as follows:
myVariableName=myValue
I then do a split against this:
set props [ split $arg = ]
Then I assign assign values to my variables:
set [lindex $props 0] [lindex $props 1]
That's all fine until my...
Hi All
I'd like to be be able to read in some data from a file, create some variable names based on the data, assign values to these variables and then access the values assigned via the newly created variable name....sorry this is confusing. Something like this:-
File contains
abc 123
If I...
Hi
Does anyone know how to set a JVM custom property in wsadmin? I know how to do it through Web Console (Application Servers > myServer > Process Definition > Java Virtual Machine > Custom Properties) but would much prefer to script this.
Any ideas? Many Thanks.
J
Yeah
We get this often . No big deal - just means DB connectivity disappers during backup and then you connection pool has some connection that are no longer valid. As you app gets connection from the pool these will be replaced with valid connections.
If it bothers you - worth doing online...
Hi
I'm still getting the same issue:
I think the problem is with :
# Then set a variable that is equal to a variable defined earlier in script
$installdir = "$myhostnameHash{$hostname}";
print "Value of installdir is $installdir\n";
What I want to achieve is:
$installdir = $wcnode; # Where...
Thanks Teriviret
Both seem to work.
$myhostnameHash{$key} = $value;
%myhostnameHash->{$key} = $value;
This is the first time I've been playing around with hashes so I'm not really sure what the difference in the two lines is.
When I retrieve the key from the has the correct value is...
Hi
Tried use strict but just got back a page full of messages along lines of:
Global symbol "$variable" requires explicit package name at ./myscript.pl line 46.
Is ther something I should be looking for?
$hostname = "myhost";
myhost is just a value.
Thanks
Hi
I'm having a problem where a variable is not being interpreted instead the name of the variable is being displayed.
sub one
{
# Some code here that sets following variable
$wcnode="avalue"
}
sub two
{
$hostname=myhost;
#Read in a config file with key/value pairs separated by '='...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.