LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 08-09-2012, 12:20 AM   #1
hackerdilli
LQ Newbie
 
Registered: Aug 2012
Posts: 4

Rep: Reputation: Disabled
Exclamation 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
 
Old 08-09-2012, 06:34 PM   #2
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 3,975

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

jlinkels
 
Old 08-09-2012, 11:06 PM   #3
hackerdilli
LQ Newbie
 
Registered: Aug 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
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 View Post
Please provide examples of which strings are supposed to match, and strings which should not match. Also the contents of $data.

jlinkels
 
  


Reply

Tags
tcl


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Me !! for sftp automation hackerdilli Programming 3 08-08-2012 06:26 AM
LXer: Restricting Users To SFTP Plus Setting Up Chrooted SSH/SFTP (Debian Squeeze) LXer Syndicated Linux News 0 09-06-2011 07:10 AM
sftp automation for downloading files chipix Linux - Security 5 07-14-2004 05:57 AM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration