Problem with put

Advertisement

p1c0
Joined:
Posts:
18
Location:
France

Problem with put

Hi all,

i have difficulties with put...

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

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

Reply with quote

Advertisement

p1c0
Joined:
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 :

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?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
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

Reply with quote

p1c0
Joined:
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...

Reply with quote

p1c0
Joined:
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!!!

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
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

Reply with quote

Advertisement

You can post new topics in this forum