LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Help Me !! for sftp automation (https://www.linuxquestions.org/questions/programming-9/help-me-for-sftp-automation-4175421141/)

hackerdilli 08-09-2012 12:20 AM

Help Me !! for sftp automation
 
Hey Guys ,
iam trying to match to string in TCL scripts but it not working .

Its only working true condition to print yes.. When condtion fail then even it prints YES

Any suggestion this ??

if {[regexp "$data.*\n(.*).*\nsftp.*" $results]} {
puts"yes"
} else { puts "no"
}

Nick

jlinkels 08-09-2012 06:34 PM

Please provide examples of which strings are supposed to match, and strings which should not match. Also the contents of $data.

jlinkels

hackerdilli 08-09-2012 11:06 PM

Thanks for replying.

the basic is .. i need to check the file wheather it is present or not..

In input file i am passing for no of files path like given below;
1)/vol/vod/ouput/file1
2)/vol/vod/ouput/file2

To read the file i am using $data arugment.

the input should be check the file with ls command and output stored into $result using "$expect_out(buffer)".

Once the ls command is done, then i need to compare the $result and $data.
[/B]
Quote:

Originally Posted by jlinkels (Post 4750348)
Please provide examples of which strings are supposed to match, and strings which should not match. Also the contents of $data.

jlinkels



All times are GMT -5. The time now is 06:41 AM.