LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-17-2011, 08:02 AM   #1
Fracker
Member
 
Registered: Mar 2009
Posts: 86

Rep: Reputation: 0
tcl stuck


hi guyz,

I have two tcl scripts, one script download files using sftp and save it to local drive. It takes two arguments one as directory where to download and 2nd file name. This script is working fine with "?" Question Marks and wildcards (*)

like ./sftp.sh $filename $dir

but i have another script which upload the file to an internet server through scp, using same logic .. BUT, the 2nd script fails with question marks and wildcards (*), but ok with exact file names.

This is quit strange for me

sftp.sh
Code:
#! /usr/bin/expect -f

set timeout 300
set HOST "exserver"
set USER "username1"
set PASSWORD "password1"
set filename [lindex $argv 0]
set local_directory [lindex $argv 1]

spawn /usr/bin/sftp $USER@$HOST
expect "password:"
send "$PASSWORD\r";
expect "sftp>"
send "cd somedir\r"
expect "sftp>"
send "lcd $local_directory\r"
expect "sftp>"
send "get $filename\r"
expect "sftp>"
send "bye\r"
expect eof
exit
scp.sh
Code:
#! /usr/bin/expect -f

set timeout 300
set HOST "intserver"
set USER "username2"
set PASSWORD "password2"
set filename [lindex $argv 0]
set local_directory [lindex $argv 1]

spawn /usr/bin/scp $local_directory/$filename $USER@$HOST:/location/path/in
expect "password:"
send "$PASSWORD\r";
expect eof
exit
Now why this scp is not working with wildcards or question marks in file-name?

Edit: Sorry for the title.

Last edited by Fracker; 05-17-2011 at 08:04 AM.
 
  


Reply


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Drive stuck, how to I un-stuck it. MikeyCarter Linux - Software 3 08-05-2009 12:57 PM
Cannot find Tcl dll ( Perl's Tcl bridge ) Xyem Linux - Software 2 08-08-2006 10:45 AM
Tcl/tk pxumsgdxpcvjm Linux - Newbie 2 03-04-2006 08:01 PM
Tcl/Tk 8.4.7 dakota rob Solaris / OpenSolaris 3 10-27-2004 03:51 PM
Stuck on chapter 5 when building Tcl-8.4.6 For LFS-5.1 deMilo Linux From Scratch 2 06-20-2004 04:31 AM


All times are GMT -5. The time now is 09:52 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration