Topic "Problem with put"

Author Message
p1c0
[View user's profile]

Joined: 2005-07-22
Posts: 18
Location: France
Hi all,

i have difficulties with put...

I try winscp /console /script=script.sh where script.sh is :

Code:

option batch on
option confirm off
open root@192.168.1.185:22
option transfer binary
cd /etc/rc.d/init.d
! rm -f iptables
put path_to_file/iptables


but it doesn't work, winscp said it can't find my file path_to_file/iptables.

How can i resolve my problem?

Thanks in advance.
p1c0
Advertisements
p1c0
[View user's profile]

Joined: 2005-07-22
Posts: 18
Location: France
Sorry,

i have just find the lcd command, it will work with this command!!

p1c0.
p1c0
[View user's profile]

Joined: 2005-07-22
Posts: 18
Location: France
Finally, i have a problem...

When i put a script on a linux box with WinSCP interface, it works perfrctly and i can execute the script locally on the linu box. But when i put the same script with

winscp /console /script=script.sh where script.sh is :

Code:
option batch on
option confirm off
open root@192.168.1.185:22
option transfer binary
cd /etc/rc.d/init.d
! rm -f iptables
put path_to_file/iptables


i can't execute the script locally. I have some interprter problems...
I try a "diff file1 file2" and all lines of my script seems to be different but there is no visible changes...

Could you help me please?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24995
Location: Prague, Czechia
I'm confused by your message. What do you refer to by "script"? script.sh or some file you are transferring?
_________________
Martin Prikryl
p1c0
[View user's profile]

Joined: 2005-07-22
Posts: 18
Location: France
Sorry, i try to put an other script in order to configure iptables so it's a file i want to transfer...
p1c0
[View user's profile]

Joined: 2005-07-22
Posts: 18
Location: France
I have found my problem : my file is in DOS format, so there are \r\n at end of lines.

I have to find how to translate my file in unix format, i've seen dos2unix on the net... i will try this!!!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24995
Location: Prague, Czechia
p1c0 wrote:
I have found my problem : my file is in DOS format, so there are \r\n at end of lines.

I have to find how to translate my file in unix format, i've seen dos2unix on the net... i will try this!!!

Use 'option transfer ascii' to enable on-transfer conversion.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License