Sponsored Content
Top Forums Shell Programming and Scripting Automating pbrun /bin/su not working, whenever manually it is working using putty Post 302961573 by RudiC on Tuesday 1st of December 2015 10:56:56 AM
Old 12-01-2015
Wouldn't the -c option to su work?
 

10 More Discussions You Might Find Interesting

1. Solaris

/usr/bin/cut not working with largefiles on Solaris 10

I have a person running a perl script that is parsing > 2G log files and pipes to cut -d " " -f 1,6,7,8... The script itself is in a nfs mounted home directory. It runs fine when started from a solaris 8 box but fails after about 400 lines when started from the solaris 10 box. The solaris... (1 Reply)
Discussion started by: wottie
1 Replies

2. Shell Programming and Scripting

#/usr/bin/csh -f not working as expected?

Hey everyone, A coworker of mine has written a csh script that starts with #!/usr/bin/csh -f. It's my understanding that the -f should skip the .cshrc and .login files, but here's the problem: In the script "line" is used, and I happen to have a "line" in my ~/bin. When the script is ran my... (4 Replies)
Discussion started by: effigy
4 Replies

3. Shell Programming and Scripting

#!/bin/bash has stopped working

Hi I'm writing a script and I've put #!/bin/bash as the first line so that I can just type my scripts name 'whodate' at PS1 instead of ./whodate. This has suddenly stopped working for me. It used to be the case that I could start a script with #!/bin/bash and it would work, but for this script... (2 Replies)
Discussion started by: zorrokan
2 Replies

4. Shell Programming and Scripting

Script is not working from cron while working manually

Hello, I am facing a very strange problem when I run my script manuallu ./Fetchcode which is using to connect with MKS integrity from linux end it workks fine but when I run it from cron it doesn't work.Can someone help me 1) How could I check my script when it is running from cron like... (3 Replies)
Discussion started by: anuragpgtgerman
3 Replies

5. Shell Programming and Scripting

Getting issue while running it from cron while manually working fine

Hello, I am working one one script where I am using the below code which is using to connect with MKS client when I run my script manually it works effiecently i.e. it connects with MKS client but when I run it from CRON it doesn't connect. 1)Can some one tell when it is running from cron... (1 Reply)
Discussion started by: anuragpgtgerman
1 Replies

6. Shell Programming and Scripting

/usr/local/bin/expr function not working

Legends, I am not able to set "expr" function in ksh script. Below is the sample code i used, and output is as "Syntax error" Please help me to come out of it. OUTPUT (9 Replies)
Discussion started by: sdosanjh
9 Replies

7. Solaris

Putty SSH connection not working

I am trying to connect to a solaris server using putty from a indows client. SSH connection is not working. The terminal indow just gives an error message "Network error:Connection refused". I verified SSHD and its running correctly! #svcs -p ssh STATE STIME FMRI online 17:54:44... (3 Replies)
Discussion started by: herbich1985
3 Replies

8. Shell Programming and Scripting

Script not working in cron but working fine manually

Help. My script is working fine when executed manually but the cron seems not to catch up the command when registered. The script is as follow: #!/bin/sh for file in file_1.txt file_2.txt file_3.txt do awk '{ print "0" }' $file > tmp.tmp mv tmp.tmp $file done And the cron... (2 Replies)
Discussion started by: jasperux
2 Replies

9. Shell Programming and Scripting

Script working when run manually but not in crontab showing path not found

i have a script running using variable defined in .profile when i run that script manually its working but when i run the same script through cron its giving path not found I had defined path in .profile (3 Replies)
Discussion started by: raj_saini20
3 Replies

10. Shell Programming and Scripting

Nested if not working with /usr/xpg4/bin/awk

Hi, I am trying to do if inside the If in /usr/xpg4/bin/awk. But I am getting below error : /usr/xpg4/bin/awk -v a="${THREADIDARR }" 'BEGIN {FS="|"; n=split(a,b," "); for(i=1; i<=n; i++) c]=1;} length($3) == 0{ftag == 1{{print}}; length($3) != 0{$3 in c{ftag=1;print;} !$3 in c{ftag=0;}}'... (4 Replies)
Discussion started by: nes
4 Replies
Test::MockObject::Extends(3pm)				User Contributed Perl Documentation			    Test::MockObject::Extends(3pm)

NAME
Test::MockObject::Extends - mock part of an object or class SYNOPSIS
use Some::Class; use Test::MockObject::Extends; # create an object to mock my $object = Some::Class->new(); # wrap that same object with a mocking wrapper $object = Test::MockObject::Extends->new( $object ); # now chain mock and control calls $object->set_true( 'parent_method' ) ->set_always( -grandparent_method => 1 ) ->clear(); DESCRIPTION
Test::MockObject::Extends lets you mock one or more methods of an existing object or class. This can be very handy when you're testing a well-factored module that does almost exactly what you want. Wouldn't it be handy to take control of a method or two to make sure you receive testable results? Now you can. METHODS
"new( $object | $class )" "new()" takes one optional argument, the object or class to mock. If you're mocking a method for an object that holds internal state, create an appropriate object, then pass it to this constructor. NOTE: this will modify the object in place. If you're mocking an object that does not need state, as in the cases where there's no internal data or you'll only be calling class methods, or where you'll be mocking all of the access to internal data, you can pass in the name of the class to mock partially. If you've not yet loaded the class, this method will try to load it for you. This may fail, so beware. If you pass no arguments, it will assume you really meant to create a normal "Test::MockObject" object and will oblige you. Note that if you pass a class, the object returned will appear to be an instance of that class; this does not mock the class itself. "mock( $methodname, $sub_ref )" See the documentation for Test::MockObject for all of the ways to mock methods and to retrieve method logging information. These methods return the invocant, so you can chain them. "unmock( $methodname )" Removes any active mocking of the named method. This means any calls to that method will hit the method of that name in the class being mocked, if it exists. This method returns the invocant, you can chain it. "isa( $class )" As you'd expect from a mocked object, this will return true for the class it's mocking. INTERNAL METHODS
To do its magic, this module uses several internal methods: o "check_class_loaded( $parent_class )" This verifies that you have the mockee defined. If not, it attempts to load the corresponding module for you. o "gen_autoload( $extended )" Returns an AUTOLOAD subroutine for the mock object that checks that the extended object (or class) can perform the requested method, that Test::MockObject can perform it, or that the parent has an appropriate AUTOLOAD of its own. (It should have its own "can()" in that case too though.) o "gen_can( $extended )" Returns a "can()" method for the mock object that respects the same execution order as "gen_autoload()". o "gen_isa( $extended )" Returns an "isa()" method for the mock object that claims to be the $extended object appropriately. o "gen_get_parents( $extended )" Returns a "__get_parents()" method for the mock object that claims to be the $extended object appropriately. o "gen_package( $extended )" Creates a new unique package for the mock object with the appropriate methods already installed. o "get_class( $invocant )" Returns the class name of the invocant, whether it's an object or a class name. CAVEATS
There may be some weird corner cases with dynamically generated methods in the mocked class. You really should use subroutine declarations though, or at least set "can()" appropriately. There are also potential name collisions with methods in this module or "Test::MockObject", though this should be rare. AUTHOR
chromatic, <chromatic at wgz dot org> Documentation bug fixed by Stevan Little. Additional AUTOLOAD approach suggested by Adam Kennedy. Other bugs reported by Paul the Nomad and Praveen Ray. Thank you all! BUGS
No known bugs. COPYRIGHT
Copyright (c) 2004 - 2011, chromatic. All rights reserved. You may use, modify, and distribute this module under the same terms as Perl 5.10 perl v5.14.2 2012-03-04 Test::MockObject::Extends(3pm)
All times are GMT -4. The time now is 05:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy