Sponsored Content
Full Discussion: return ftp status
Top Forums Shell Programming and Scripting return ftp status Post 23349 by blt123 on Friday 21st of June 2002 11:57:33 AM
Old 06-21-2002
Network

Thanks!

In the past, I have checked for "226". There have been some cases where the bytes transferred, bytes sent, or transfer time contains "226". The job result is successful, yet the ftp was not successful. So this doesn't always work for my scenario.

The translation of code 226 is not consistent on all boxes. For example, I have seen "226 Closing data connection" or "226 Transfer Complete" as a translation for code 226.

I do have -v in my ftp command line. Because the "226" code is not consistent, the status returned is not always reliable.

Thanks,
Barbara
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Return status...

Hello there! Here is my problem. I hope I can get some help about it. I need to know how can I get the return code of an application in the Unix shell script. The script is like below: PREVIOUS STATEMENT & VARIABLES sqlplus scott/tiger @$sqldir/$sqlscript NEXT STATEMENT (Like... (7 Replies)
Discussion started by: Shaz
7 Replies

2. Shell Programming and Scripting

Return status of all previous runs

hi, I set the crontab to execute script A every 5 minutes from 9:00 am to 4:00 pm everyday, now at 12:00am I want to run another script if and only if all the previous runs of script A return OK, can anyone tell me how it could be done? thank you very very much! (4 Replies)
Discussion started by: mpang_
4 Replies

3. Shell Programming and Scripting

Verify scp return status

Hi all below is a snippet of my perl codesystem ("scp -pq $dest_file $path");How i can i trap the return status? ie if the scp fails how can i know ? (2 Replies)
Discussion started by: new2ss
2 Replies

4. HP-UX

Return of EXIT status ( $? )

I have the question: How return the exit code from then assign : VAR=$(command ) for ex. VAR=$(ls ....) VAREXIT=$? echo $VAREXIT VAREXIT is equal to 0 if the directory exist or not exist. WHI?? if i execute the command direct from line-command , the value of $? is different if... (1 Reply)
Discussion started by: ZINGARO
1 Replies

5. Shell Programming and Scripting

evaluate return status of a function

Hi all I'm trying to evalute the return status of a function without much success. I've put a very basic example below to explain. check_ok() works fine but when used within an if statement, it always returns true, whether it is true or false. I'm guessing it returns true as the function... (4 Replies)
Discussion started by: tig2810
4 Replies

6. Shell Programming and Scripting

capturing C++ binary return status in perl

Hello, I have a C++ binary that runs in my perl script. But, Currently, the binary is doing a core dump and i want to capture the retrun status of the binary to report as an issue. Can you please help me on this. Thanks, Sateesh (1 Reply)
Discussion started by: kotasateesh
1 Replies

7. Shell Programming and Scripting

return status after run the shell script

Hello, I wanted to delete all files which are placed 14 days back. Here is my below script. My script works very well and it deletes all files 14 days back. I wanted to display message incase if the delete script is not successful. The below script returns always successful. But the directory... (6 Replies)
Discussion started by: govindts
6 Replies

8. UNIX for Dummies Questions & Answers

opposite return status in c shell

there is something wrong with my system. when I do this: diff file1 file1 && echo 1 the output is 1. but diff file1 file2 >/dev/null && echo 1 output nothing while diff file1 file2 >/dev/null || echo 1 shows 1. the same with "grep" return status. they are both GNU utilities.... (5 Replies)
Discussion started by: phil518
5 Replies

9. Shell Programming and Scripting

Return Status

Hi can you explain me, what does variables $@ and $* return and how are they used, if can give me a sample example it could be helpful. Thanks in advance, Regards, Abhishek S. (1 Reply)
Discussion started by: abhisheksunkari
1 Replies

10. UNIX for Beginners Questions & Answers

How to see the status of all the ftp put & get files logs and curent ftp transfer status ?

How to see the status of all the ftp put & get files logs and curent ftp transfer status if any active ftp running in the background ? (2 Replies)
Discussion started by: i4ismail
2 Replies
Permute(3pm)						User Contributed Perl Documentation					      Permute(3pm)

NAME
Algorithm::Permute - Handy and fast permutation with object oriented interface SYNOPSIS
use Algorithm::Permute; # default is to create n of n objects permutation generator my $p = new Algorithm::Permute(['a'..'d']); # but also you can create r of n objects permutation generator, where r <= n my $p = new Algorithm::Permute([1..4], 3); while (@res = $p->next) { print join(", ", @res), " "; } # and this one is the speed demon: my @array = (1..9); Algorithm::Permute::permute { print "@array " } @array; DESCRIPTION
This handy module makes performing permutation in Perl easy and fast, although perhaps its algorithm is not the fastest on the earth. It supports permutation r of n objects where 0 < r <= n. METHODS
new [@list] Returns a permutor object for the given items. next Returns a list of the items in the next permutation. The order of the resulting permutation is the same as of the previous version of "Algorithm::Permute". peek Returns the list of items which will be returned by next(), but doesn't advance the sequence. Could be useful if you wished to skip over just a few unwanted permutations. reset Resets the iterator to the start. May be used at any time, whether the entire set has been produced or not. Has no useful return value. CALLBACK STYLE INTERFACE
Starting with version 0.03, there is a function - not exported by default - which supports a callback style interface: permute BLOCK ARRAY A block of code is passed, which will be executed for each permutation. The array will be changed in place, and then changed back again before "permute" returns. During the execution of the callback, the array is read-only and you'll get an error if you try to change its length. (You can change its elements, but the consequences are liable to confuse you and may change in future versions.) You have to pass an array, it can't just be a list. It does work with special arrays and tied arrays, though unless you're doing something particularly abstruse you'd be better off copying the elements into a normal array first. Example: my @array = (1..9); permute { print "@array " } @array; The code is run inside a pseudo block, rather than as a normal subroutine. That means you can't use "return", and you can't jump out of it using "goto" and so on. Also, "caller" won't tell you anything helpful from inside the callback. Such is the price of speed. The order in which the permutations are generated is not guaranteed, so don't rely on it. The low-level hack behind this function makes it currently the fastest way of doing permutation among others. COMPARISON
I've collected some Perl routines and modules which implement permutation, and do some simple benchmark. The whole result is the following. Permutation of eight scalars: Abigail's : 9 wallclock secs ( 8.07 usr + 0.30 sys = 8.37 CPU) Algorithm::Permute : 5 wallclock secs ( 5.72 usr + 0.00 sys = 5.72 CPU) Algorithm::Permute qw(permute): 2 wallclock secs ( 1.65 usr + 0.00 sys = 1.65 CPU) List::Permutor : 27 wallclock secs (26.73 usr + 0.01 sys = 26.74 CPU) Memoization : 32 wallclock secs (32.55 usr + 0.02 sys = 32.57 CPU) perlfaq4 : 36 wallclock secs (35.27 usr + 0.02 sys = 35.29 CPU) Permutation of nine scalars (the Abigail's routine is commented out, because it stores all of the result in memory, swallows all of my machine's memory): Algorithm::Permute : 43 wallclock secs ( 42.93 usr + 0.04 sys = 42.97 CPU) Algorithm::Permute qw(permute): 15 wallclock secs ( 14.82 usr + 0.00 sys = 14.82 CPU) List::Permutor : 227 wallclock secs (226.46 usr + 0.22 sys = 226.68 CPU) Memoization : 307 wallclock secs (306.69 usr + 0.43 sys = 307.12 CPU) perlfaq4 : 272 wallclock secs (271.93 usr + 0.33 sys = 272.26 CPU) The benchmark script is included in the bench directory. I understand that speed is not everything. So here is the list of URLs of the alternatives, in case you hate this module. o Memoization is discussed in chapter 4 Perl Cookbook, so you can get it from O'Reilly: ftp://ftp.oreilly.com/published/oreilly/perl/cookbook o Abigail's: http://www.foad.org/~abigail/Perl o List::Permutor: http://www.cpan.org/modules/by-module/List o The classic way, usually used by Lisp hackers: perldoc perlfaq4 AUTHOR
Edwin Pratomo, edpratomo@cpan.org. The object oriented interface is taken from Tom Phoenix's "List::Permutor". Robin Houston <robin@kitsite.com> invented and contributed the callback style interface. ACKNOWLEDGEMENT
Yustina Sri Suharini - my ex-fiance-now-wife, for providing the permutation problem to me. SEE ALSO
o Data Structures, Algorithms, and Program Style Using C - Korsh and Garrett o Algorithms from P to NP, Vol. I - Moret and Shapiro perl v5.14.2 2008-04-23 Permute(3pm)
All times are GMT -4. The time now is 04:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy