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

Advertisement

p1c0

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:
41,517
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.

Reply with quote

Advertisement

You can post new topics in this forum