Re: [uClinux-dev] ( subshell ) | telnet --> not workingon WildFireucLinux

2009-03-10 Thread Tom Stalcup

Bob,

I used the subshell like this (I think the parens are necessary):

( sleep 1; echo username; sleep 1; etc... ) | telnet 10.0.0.24 23

And I need the last line to tell where to telnet to.  When I telnet in 
manually, I can do it successfully with or without the port number (23) at 
the end.


To answer you question, it seems nothing works in the subshell.  I tried 
putting sleep 1000; in there and it still took about a half second to return 
the prompt, with no error reported.  Also thought it may just be telneting 
in really fast, so I put in a command to cp a file that exits on the remote 
server to a new filename, but it didn't work, so I don't think it's 
telneting or sleeping.  I don't see anything printed to the console, so I 
don't think echo is working in the subshell either.


For example, say I call my scrip t-net, here's what my session looks like:

# ./t-net
#

only after about 1/2 second or so after entering 't-net'

On a different uClinux system I could watch the whole telnet session in real 
time on the console as the script ran.


Tom

- Original Message - 
From: "Bob Furber" 

To: "uClinux development list" 
Sent: Tuesday, March 10, 2009 11:49 AM
Subject: Re: [uClinux-dev] ( subshell ) | telnet --> not workingon 
WildFireucLinux




Hi Tom,

Thanks for the help.  I tried enabling msh (I think it was already 
enabled...when it boots up it says BusyBox...(msh)).  And I put the 
#!/bin/msh as the header, but it still didn't work.


Could we ask you to be a little more specific: Can you tell us what part 
of your script did not work by removing lines?


The script you claim is causing grief was:

#!/bin/sh
sleep 1;
echo username;
sleep 1;
echo pwd;
sleep 1;
echo [various commands];
sleep 1;
echo exit  | telnet 10.0.0.25 23  <-- Not sure about this line

Does it sleep?

Does it echo?

What happens if you remove the last line?

Although there are numerous scripts in .../Vendors/Intec/WildFireMod/ 
which are happily executed by the WildFireMod/uClinux, I could not find 
any that "sleep" and there are none that "telnet". So, some 
experimentation is in order to narrow down the services that have not been 
enabled.


Bfn,

Bob Furber



Would appreciate any more advice, also in regards to what version of 
Linux I should load onto one of our PC's in order to tweak the kernel, 
and if creating a dual-boot XP/Linux PC would be OK.


Thanks,

Tom

- Original Message - From: "Bob Furber" 
To: "uClinux development list" 
Sent: Monday, March 09, 2009 7:41 PM
Subject: Re: [uClinux-dev] ( subshell ) | telnet --> not working on 
WildFireucLinux




Tom,


I'm having difficulty telneting withing a subshell script like this:

#!/bin/sh
( sleep 1; echo username; sleep 1; echo pwd; sleep 1; echo [various 
commands]; sleep 1; echo exit ) | telnet 10.0.0.25 23


The above worked fine on our Atmel board running uClinux, but it isn't 
working on our Motorola board (specifically the WildFire board which 
uses the MCF5282).


The WildFire board is running firmware from here: 
ftp://ftp.sbctools.com/pub/uClinux/WildFire/wildfire-uC-firmware.zip

And here are the two files I put on, following the above instructions:


For anyone wishing to help Tom,

1) linux.gz.bin


The linux image to load in flash


2) jffs2.img.bin


The romfs image to load in flash ..using dBUG>dnfl linux.gz.bin 
jffs2.img.bin

..which install both these images in flash using TFTP.

I can telnet just fine manually, but need to have the board to do it 
automatically via a subshell script. Does anyone know why the subshell 
script wouldn't be working?


My guess is that the BUSYBOX_MSH needs to be tweaked to offer the 
services you need.


On a LinuxPC make a copy of your uClinux source tree. Then run make 
xconfig. Select Vendor Intec & platform WildFireMod. Then go into the 
"Kernel/Library/Defaults section and select 'y' for "Customize 
Vendor/Users Settings" and, possibly "Update Default Vendor Settings". 
Then click "Main Menu" which will return you to the main menu where you 
can "Save and Exit". But now you will be prompted with a lengthy "kernel 
configuration dialog".


A lot of the options here are self explanatory, and they also contain 
some documentation. See the bottom of the window when you select and 
option for more information. The key concept here is "if in doubt leave 
out" ..or leave it as it is.


After going through all of these options carefully (using the existing 
boards as a template) you can exit this part of the configuration by 
selecting File?Quit and then saying "Yes" to save changes. After this 
dialog disappears another dialog with a bunch of buttons appears for 
selecting the user applications to include by default in the final image 
..such as BusyBox, Network A

Re: [uClinux-dev] ( subshell ) | telnet --> not workingon WildFireucLinux

2009-03-10 Thread Bob Furber

Hi Tom,


I used the subshell like this (I think the parens are necessary):

( sleep 1; echo username; sleep 1; etc... ) | telnet 10.0.0.24 23


I am not familiar with scripts in brackets. In fact, I know little about 
scripting. And I do not have access to a uClinux board right now.


However, I do know that the uClinux loaded on the WildFireMod happily 
executes scripts. On startup it executes /etc/rc. If you have uClinux 
loaded in flash, try running prep-sdcard.sh which will partition a SD 
card and echo its progress.



And I need the last line to tell where to telnet to.  When I telnet in 
manually, I can do it successfully with or without the port number 
(23) at the end.


So, telnetting is NOT a problem?



To answer you question, it seems nothing works in the subshell.  I 
tried putting sleep 1000; in there and it still took about a half 
second to return the prompt, with no error reported.  


So, "sleep" may be the problem?

Also thought it may just be telneting in really fast, so I put in a 
command to cp a file that exits on the remote server to a new 
filename, but it didn't work, so I don't think it's telneting or 
sleeping.  I don't see anything printed to the console, so I don't 
think echo is working in the subshell either.


..yet etc/rc merrily echos every time you boot uClinux...

For example, say I call my scrip t-net, here's what my session looks 
like:


# ./t-net
#

only after about 1/2 second or so after entering 't-net'


Forgive my ignorance, but, could the bracketed script be part of the 
problem? Can you test a couple of conventional multi-line scripts?


On a different uClinux system I could watch the whole telnet session 
in real time on the console as the script ran.


What shell was it running? Do you have access to its uClinux 
configuration? What shell does it use? What services are enabled/disabled?


If you can figure all this out, you should be able to configure uClinux 
for the WildFireMod exactly the same.


Bfn,

Bob Furber



Tom

- Original Message - From: "Bob Furber" 
To: "uClinux development list" 
Sent: Tuesday, March 10, 2009 11:49 AM
Subject: Re: [uClinux-dev] ( subshell ) | telnet --> not workingon 
WildFireucLinux




Hi Tom,

Thanks for the help.  I tried enabling msh (I think it was already 
enabled...when it boots up it says BusyBox...(msh)).  And I put the 
#!/bin/msh as the header, but it still didn't work.


Could we ask you to be a little more specific: Can you tell us what 
part of your script did not work by removing lines?


The script you claim is causing grief was:

#!/bin/sh
sleep 1;
echo username;
sleep 1;
echo pwd;
sleep 1;
echo [various commands];
sleep 1;
echo exit  | telnet 10.0.0.25 23  <-- Not sure about this line

Does it sleep?

Does it echo?

What happens if you remove the last line?

Although there are numerous scripts in .../Vendors/Intec/WildFireMod/ 
which are happily executed by the WildFireMod/uClinux, I could not 
find any that "sleep" and there are none that "telnet". So, some 
experimentation is in order to narrow down the services that have not 
been enabled.


Bfn,

Bob Furber



Would appreciate any more advice, also in regards to what version of 
Linux I should load onto one of our PC's in order to tweak the 
kernel, and if creating a dual-boot XP/Linux PC would be OK.


Thanks,

Tom

- Original Message - From: "Bob Furber" 
To: "uClinux development list" 
Sent: Monday, March 09, 2009 7:41 PM
Subject: Re: [uClinux-dev] ( subshell ) | telnet --> not working on 
WildFireucLinux




Tom,


I'm having difficulty telneting withing a subshell script like this:

#!/bin/sh
( sleep 1; echo username; sleep 1; echo pwd; sleep 1; echo 
[various commands]; sleep 1; echo exit ) | telnet 10.0.0.25 23


The above worked fine on our Atmel board running uClinux, but it 
isn't working on our Motorola board (specifically the WildFire 
board which uses the MCF5282).


The WildFire board is running firmware from here: 
ftp://ftp.sbctools.com/pub/uClinux/WildFire/wildfire-uC-firmware.zip
And here are the two files I put on, following the above 
instructions:


For anyone wishing to help Tom,

1) linux.gz.bin


The linux image to load in flash


2) jffs2.img.bin


The romfs image to load in flash ..using dBUG>dnfl linux.gz.bin 
jffs2.img.bin

..which install both these images in flash using TFTP.

I can telnet just fine manually, but need to have the board to do 
it automatically via a subshell script. Does anyone know why the 
subshell script wouldn't be working?


My guess is that the BUSYBOX_MSH needs to be tweaked to offer the 
services you need.


On a LinuxPC make a copy of your uClinux source tree. Then run make 
xconfig. Select Vendor Intec & platform WildFireMod. Then go into 
the "Kernel/Library/Defaults section and select 'y' for "Customize

Re: [uClinux-dev] ( subshell ) | telnet --> not workingon WildFireucLinux

2009-03-10 Thread Jamie Lokier
Bob Furber wrote:
> >( sleep 1; echo username; sleep 1; etc... ) | telnet 10.0.0.24 23

At least on my Busybox-based system, telnet cannot be used with input
from a pipe.

If you do that, it just exits with status 1 (error status).

-- Jamie
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] ( subshell ) | telnet -->not workingon WildFireucLinux

2009-03-10 Thread Tom Stalcup

Bob,

No telneting isn't a problem if I do it manually.  And I can run other 
multi-line scripts just fine.


The board I was using before that could run the telnet subshell script was 
the Atmel NGW100.  I have a few of them here and it seems all have failed 
one way or another.  I was able to get one to boot long enough to get the 
following info about the kernel used:


Board: Atmel NGW100
  Image Name:   Linux-2.6.18-atngw
  Image Type:   AVR32 Linux Kernel Image (gzip compressed)
  Data Size:912607 Bytes = 891.2 kB

Tom

- Original Message - 
From: "Bob Furber" 

To: "uClinux development list" 
Sent: Tuesday, March 10, 2009 1:40 PM
Subject: Re: [uClinux-dev] ( subshell ) | telnet -->not workingon 
WildFireucLinux




Hi Tom,


I used the subshell like this (I think the parens are necessary):

( sleep 1; echo username; sleep 1; etc... ) | telnet 10.0.0.24 23


I am not familiar with scripts in brackets. In fact, I know little about 
scripting. And I do not have access to a uClinux board right now.


However, I do know that the uClinux loaded on the WildFireMod happily 
executes scripts. On startup it executes /etc/rc. If you have uClinux 
loaded in flash, try running prep-sdcard.sh which will partition a SD card 
and echo its progress.



And I need the last line to tell where to telnet to.  When I telnet in 
manually, I can do it successfully with or without the port number (23) 
at the end.


So, telnetting is NOT a problem?



To answer you question, it seems nothing works in the subshell.  I tried 
putting sleep 1000; in there and it still took about a half second to 
return the prompt, with no error reported.


So, "sleep" may be the problem?

Also thought it may just be telneting in really fast, so I put in a 
command to cp a file that exits on the remote server to a new filename, 
but it didn't work, so I don't think it's telneting or sleeping.  I don't 
see anything printed to the console, so I don't think echo is working in 
the subshell either.


..yet etc/rc merrily echos every time you boot uClinux...

For example, say I call my scrip t-net, here's what my session looks 
like:


# ./t-net
#

only after about 1/2 second or so after entering 't-net'


Forgive my ignorance, but, could the bracketed script be part of the 
problem? Can you test a couple of conventional multi-line scripts?


On a different uClinux system I could watch the whole telnet session in 
real time on the console as the script ran.


What shell was it running? Do you have access to its uClinux 
configuration? What shell does it use? What services are enabled/disabled?


If you can figure all this out, you should be able to configure uClinux 
for the WildFireMod exactly the same.


Bfn,

Bob Furber



Tom

- Original Message - From: "Bob Furber" 
To: "uClinux development list" 
Sent: Tuesday, March 10, 2009 11:49 AM
Subject: Re: [uClinux-dev] ( subshell ) | telnet --> not workingon 
WildFireucLinux




Hi Tom,

Thanks for the help.  I tried enabling msh (I think it was already 
enabled...when it boots up it says BusyBox...(msh)).  And I put the 
#!/bin/msh as the header, but it still didn't work.


Could we ask you to be a little more specific: Can you tell us what part 
of your script did not work by removing lines?


The script you claim is causing grief was:

#!/bin/sh
sleep 1;
echo username;
sleep 1;
echo pwd;
sleep 1;
echo [various commands];
sleep 1;
echo exit  | telnet 10.0.0.25 23  <-- Not sure about this line

Does it sleep?

Does it echo?

What happens if you remove the last line?

Although there are numerous scripts in .../Vendors/Intec/WildFireMod/ 
which are happily executed by the WildFireMod/uClinux, I could not find 
any that "sleep" and there are none that "telnet". So, some 
experimentation is in order to narrow down the services that have not 
been enabled.


Bfn,

Bob Furber



Would appreciate any more advice, also in regards to what version of 
Linux I should load onto one of our PC's in order to tweak the kernel, 
and if creating a dual-boot XP/Linux PC would be OK.


Thanks,

Tom

- Original Message - From: "Bob Furber" 
To: "uClinux development list" 
Sent: Monday, March 09, 2009 7:41 PM
Subject: Re: [uClinux-dev] ( subshell ) | telnet --> not working on 
WildFireucLinux




Tom,


I'm having difficulty telneting withing a subshell script like this:

#!/bin/sh
( sleep 1; echo username; sleep 1; echo pwd; sleep 1; echo [various 
commands]; sleep 1; echo exit ) | telnet 10.0.0.25 23


The above worked fine on our Atmel board running uClinux, but it 
isn't working on our Motorola board (specifically the WildFire board 
which uses the MCF5282).


The WildFire board is running firmware from here: 
ftp://ftp.sbctools.com/pub/uClinux/WildFire/wildfire-uC-firmware.zip
And here are the two files I put on, f

Re: [uClinux-dev] ( subshell ) | telnet -->not workingon WildFireucLinux

2009-03-10 Thread Bob Furber

Hi Tom,

No telneting isn't a problem if I do it manually.  And I can run other 
multi-line scripts just fine.


How about "sleep"?

Is the problem as Jamie mentioned that busybox-msh telnet cannot be used 
with input from a pipe?


To list at large: Is there a way around this?

The board I was using before that could run the telnet subshell script 
was the Atmel NGW100.  I have a few of them here and it seems all have 
failed one way or another.  I was able to get one to boot long enough 
to get the following info about the kernel used:


Board: Atmel NGW100
  Image Name:   Linux-2.6.18-atngw
  Image Type:   AVR32 Linux Kernel Image (gzip compressed)
  Data Size:912607 Bytes = 891.2 kB


Regrettably, this not tell us how its Linux was configured. It does not 
tell us what services were enabled/disabled.


However..

If you have the source tree, you should be able to run "make xconfig" to 
get a blow by blow description of your Linux-2.6.18-atngw's 
configuration. To be on the safe side, run "make xconfig" on a copy of 
your source tree.


Bob Furber



Tom

- Original Message - From: "Bob Furber" 
To: "uClinux development list" 
Sent: Tuesday, March 10, 2009 1:40 PM
Subject: Re: [uClinux-dev] ( subshell ) | telnet -->not workingon 
WildFireucLinux




Hi Tom,


I used the subshell like this (I think the parens are necessary):

( sleep 1; echo username; sleep 1; etc... ) | telnet 10.0.0.24 23


I am not familiar with scripts in brackets. In fact, I know little 
about scripting. And I do not have access to a uClinux board right now.


However, I do know that the uClinux loaded on the WildFireMod happily 
executes scripts. On startup it executes /etc/rc. If you have uClinux 
loaded in flash, try running prep-sdcard.sh which will partition a SD 
card and echo its progress.



And I need the last line to tell where to telnet to.  When I telnet 
in manually, I can do it successfully with or without the port 
number (23) at the end.


So, telnetting is NOT a problem?



To answer you question, it seems nothing works in the subshell.  I 
tried putting sleep 1000; in there and it still took about a half 
second to return the prompt, with no error reported.


So, "sleep" may be the problem?

Also thought it may just be telneting in really fast, so I put in a 
command to cp a file that exits on the remote server to a new 
filename, but it didn't work, so I don't think it's telneting or 
sleeping.  I don't see anything printed to the console, so I don't 
think echo is working in the subshell either.


..yet etc/rc merrily echos every time you boot uClinux...

For example, say I call my scrip t-net, here's what my session looks 
like:


# ./t-net
#

only after about 1/2 second or so after entering 't-net'


Forgive my ignorance, but, could the bracketed script be part of the 
problem? Can you test a couple of conventional multi-line scripts?


On a different uClinux system I could watch the whole telnet session 
in real time on the console as the script ran.


What shell was it running? Do you have access to its uClinux 
configuration? What shell does it use? What services are 
enabled/disabled?


If you can figure all this out, you should be able to configure 
uClinux for the WildFireMod exactly the same.


Bfn,

Bob Furber



Tom

- Original Message - From: "Bob Furber" 
To: "uClinux development list" 
Sent: Tuesday, March 10, 2009 11:49 AM
Subject: Re: [uClinux-dev] ( subshell ) | telnet --> not workingon 
WildFireucLinux




Hi Tom,

Thanks for the help.  I tried enabling msh (I think it was already 
enabled...when it boots up it says BusyBox...(msh)).  And I put 
the #!/bin/msh as the header, but it still didn't work.


Could we ask you to be a little more specific: Can you tell us what 
part of your script did not work by removing lines?


The script you claim is causing grief was:

#!/bin/sh
sleep 1;
echo username;
sleep 1;
echo pwd;
sleep 1;
echo [various commands];
sleep 1;
echo exit  | telnet 10.0.0.25 23  <-- Not sure about this line

Does it sleep?

Does it echo?

What happens if you remove the last line?

Although there are numerous scripts in 
.../Vendors/Intec/WildFireMod/ which are happily executed by the 
WildFireMod/uClinux, I could not find any that "sleep" and there 
are none that "telnet". So, some experimentation is in order to 
narrow down the services that have not been enabled.


Bfn,

Bob Furber



Would appreciate any more advice, also in regards to what version 
of Linux I should load onto one of our PC's in order to tweak the 
kernel, and if creating a dual-boot XP/Linux PC would be OK.


Thanks,

Tom

- Original Message - From: "Bob Furber" 


To: "uClinux development list" 
Sent: Monday, March 09, 2009 7:41 PM
Subject: Re: [uClinux-dev] ( subshell ) | telnet --> 

Re: [uClinux-dev] ( subshell ) | telnet-->not workingon WildFireucLinux

2009-03-10 Thread Tom Stalcup

More info during the boot of the Atmel board...

## Booting image at 1020 ...
  Image Name:   Linux-2.6.18-atngw
  Image Type:   AVR32 Linux Kernel Image (gzip compressed)
  Data Size:912607 Bytes = 891.2 kB
  Load Address: 1000
  Entry Point:  9000
  Verifying Checksum ... OK
  Uncompressing Kernel Image ... OK

Starting kernel at 9000 (params at 11fc0040)...

pdc pdc.0: Atmel Peripheral DMA Controller enabled
EIM: External Interrupt Module at 0xfff0, IRQ 19
EIM: Handling 4 external IRQs, starting with IRQ 64
smc smc.0: Atmel Static Memory Controller at 0xfff03400
pio0: Atmel Port Multiplexer at 0xffe02800 (irq 13)
pio0: Handling 32 external IRQs, starting with IRQ 96
pio1: Atmel Port Multiplexer at 0xffe02c00 (irq 14)
pio1: Handling 32 external IRQs, starting with IRQ 128
pio2: Atmel Port Multiplexer at 0xffe03000 (irq 15)
pio2: Handling 32 external IRQs, starting with IRQ 160
pio3: Atmel Port Multiplexer at 0xffe03400 (irq 16)
pio3: Handling 32 external IRQs, starting with IRQ 192
pio4: Atmel Port Multiplexer at 0xffe03800 (irq 17)
pio4: Handling 32 external IRQs, starting with IRQ 224
dmac0: DesignWare DMA controller at 0xff20 irq 2
NET: Registered protocol family 2
IP route cache hash table entries: 256 (order: -2, 1024 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler cfq registered (default)
Serial: Atmel USART3 driver
usart.1: ttyS0 at MMIO 0xffe01000 (irq = 7) is a USART3
loop: loaded (max 8 devices)
eth0: Atmel MACB at 0xfff01800 irq 25 (00:04:25:1c:8a:f0)
eth1: Atmel MACB at 0xfff01c00 irq 26 (00:04:25:1c:8a:f1)
physmap platform flash device: 0080 at 
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
Amd/Fujitsu Extended Query Table at 0x0041
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
cmdlinepart partition parsing not available
RedBoot partition parsing not available
Using physmap partition information
Creating 3 MTD partitions on "physmap-flash.0":
0x-0x0002 : "u-boot"
0x0002-0x007f : "root"
0x007f-0x0080 : "env"
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xffe0 (irq 3)
mtd_dataflash spi0.0: AT45DB642x (8448 KBytes)
ip_conntrack version 2.4 (256 buckets, 2048 max) - 204 bytes per conntrack
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Time: avr32 clocksource has been installed.
VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 56K (9000 - 9000e000)
Data CRC eee6bd50 != calculated CRC 5fb9822b for node at 00675154
Data CRC eee6bd50 != calculated CRC 5fb9822b for node at 00675154
Data CRC eee6bd50 != calculated CRC 5fb9822b for node at 00675154
Data CRC eee6bd50 != calculated CRC 5fb9822b for node at 00675154
[repeats forever...]

- Original Message - 
From: "Tom Stalcup" 

To: "uClinux development list" 
Sent: Tuesday, March 10, 2009 3:09 PM
Subject: Re: [uClinux-dev] ( subshell ) | telnet-->not workingon 
WildFireucLinux




Bob,

No telneting isn't a problem if I do it manually.  And I can run other 
multi-line scripts just fine.


The board I was using before that could run the telnet subshell script was 
the Atmel NGW100.  I have a few of them here and it seems all have failed 
one way or another.  I was able to get one to boot long enough to get the 
following info about the kernel used:


Board: Atmel NGW100
  Image Name:   Linux-2.6.18-atngw
  Image Type:   AVR32 Linux Kernel Image (gzip compressed)
  Data Size:912607 Bytes = 891.2 kB

Tom

- Original Message - 
From: "Bob Furber" 

To: "uClinux development list" 
Sent: Tuesday, March 10, 2009 1:40 PM
Subject: Re: [uClinux-dev] ( subshell ) | telnet -->not workingon 
WildFireucLinux




Hi Tom,


I used the subshell like this (I think the parens are necessary):

( sleep 1; echo username; sleep 1; etc... ) | telnet 10.0.0.24 23


I am not familiar with scripts in brackets. In fact, I know little about 
scripting. And I do not have access to a uClinux board right now.


However, I do know that the uClinux loaded on the WildFireMod happily 
executes scripts. On startup it executes /etc/rc. If you have uClinux 
loaded in flash, try running prep-sdcard.sh which will partition a SD 
card and echo its progress.



And I need the last line to tell where to telnet to.  When I telnet in 
manually, I can do it successfully with or without the port number (23) 
at the end.


So, telnetting is NOT a problem?



To answer you question, it seems nothing works in the subshell.  I tried 
putting sleep 1000; in there and it still took about a half second to 
return

Re: [uClinux-dev] ( subshell ) | telnet --> not workingon WildFireucLinux

2009-03-10 Thread Bob Furber

Jamie Lokier wrote:


At least on my Busybox-based system, telnet cannot be used with input
from a pipe.
  


Is there a way around this?

Bob Furber


If you do that, it just exits with status 1 (error status).

-- Jamie
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


  


___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] ( subshell ) | telnet --> not workingon WildFireucLinux

2009-03-10 Thread Jamie Lokier
Bob Furber wrote:
> >At least on my Busybox-based system, telnet cannot be used with input
> >from a pipe.
> 
> Is there a way around this?

Try building netcat instead (the command is usually "nc").

It's more appropriate for this job, and should build easily.

-- Jamie
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] ( subshell ) | telnet--> not workingon WildFireucLinux

2009-03-10 Thread Tom Stalcup

Thank you, I'll try that.

In the meantime, I collected some more information while trying this with 
ftp.  Maybe this will help isolate the problem.


Some functions work when piping a subshell into an FTP session, but the 
printf and echo fuctions do not work properly.


( sleep 2; printf "username"; sleep 2; printf "pwd" ) | ftp 10.0.0.24

This will connect to the FTP server, which will query for the username, then 
afer a 2 second delay, apparently send a carriage return, delay again, and 
get stuck waiting for a password.  So sleep works, but the two printf's are 
sent together as a single carriage return after the first delay.


( sleep 2; echo "username"; sleep 2; echo "pwd" ) | ftp 10.0.0.24

Same behavior as the printf method, except that a single carriage return is 
sent BEFORE the initial 2 second delay.  The sreen is shown waiting for a 
password, like in the first example above.


---
# ( sleep 2; printf "username"; sleep 2; printf "pwd"; sleep 2 ) | ftp 
10.0.0.24

Name (10.0.0.24): Password:
---

I couldn't get any function to work when piping a subshell into telnet.

Tom


- Original Message - 
From: "Jamie Lokier" 

To: "uClinux development list" 
Sent: Tuesday, March 10, 2009 6:00 PM
Subject: Re: [uClinux-dev] ( subshell ) | telnet--> not workingon 
WildFireucLinux




Bob Furber wrote:

>At least on my Busybox-based system, telnet cannot be used with input
>from a pipe.

Is there a way around this?


Try building netcat instead (the command is usually "nc").

It's more appropriate for this job, and should build easily.

-- Jamie
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev 


___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] ( subshell ) | telnet--> not workingon WildFireucLinux

2009-03-10 Thread Jamie Lokier
Tom Stalcup wrote:
> In the meantime, I collected some more information while trying this with 
> ftp.  Maybe this will help isolate the problem.
> 
> Some functions work when piping a subshell into an FTP session, but the 
> printf and echo fuctions do not work properly.
> 
> ( sleep 2; printf "username"; sleep 2; printf "pwd" ) | ftp 10.0.0.24
> 
> This will connect to the FTP server, which will query for the username, 
> then afer a 2 second delay, apparently send a carriage return, delay again, 
> and get stuck waiting for a password.  So sleep works, but the two printf's 
> are sent together as a single carriage return after the first delay.
> 
> ( sleep 2; echo "username"; sleep 2; echo "pwd" ) | ftp 10.0.0.24
> 
> Same behavior as the printf method, except that a single carriage return is 
> sent BEFORE the initial 2 second delay.  The sreen is shown waiting for a 
> password, like in the first example above.

If you're using a no-MMU architecture, you may get better results with

   sh -c 'sleep 2; echo "username"; sleep 2; echo "pwd"' | ftp 10.0.0.24

(for example).

-- Jamie
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] ( subshell ) |telnet--> not workingon WildFireucLinux

2009-03-11 Thread Enrik Berkhan
On Wed, Mar 11, 2009 at 12:27:39AM +0100, Jamie Lokier wrote:
> If you're using a no-MMU architecture, you may get better results with
> 
>sh -c 'sleep 2; echo "username"; sleep 2; echo "pwd"' | ftp 10.0.0.24
> 
> (for example).

Yes, that's right. buysbox/msh has some problems when it comes to subshells,
pipes and internal commands. It's easy to test this using `cat' instead
of ftp:

# ( date; sleep 2; date ; sleep 2; date ) | cat
Wed Mar 11 07:09:17 UTC 2009
Wed Mar 11 07:09:17 UTC 2009
Wed Mar 11 07:09:17 UTC 2009

# sh -c 'date; sleep 2; date ; sleep 2; date' | cat
Wed Mar 11 07:09:29 UTC 2009
Wed Mar 11 07:09:31 UTC 2009
Wed Mar 11 07:09:33 UTC 2009

# ( date; sleep 2; date ; sleep 2; date )
Wed Mar 11 07:10:03 UTC 2009
Wed Mar 11 07:10:05 UTC 2009
Wed Mar 11 07:10:07 UTC 2009

In general, it's a "hack" to drive real interactive programs like `ftp'
and `telnet' from pipes. You'd better use something like `expect' for
that. Of course, that's not an option on small embedded (NOMMU) systems.
So better use non-interactive tools like `netcat' or `rsh'-like stuff
instead.

Enrik
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] ( subshell ) | telnet --> not workingon WildFireucLinux

2009-03-11 Thread Michael Schnell



At least on my Busybox-based system, telnet cannot be used with input
from a pipe.
  

I don't think that is true.

the very simple "sh" shell can't do pipes. msh (from busybox) can.

-Michael
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] ( subshell ) |telnet--> not workingon WildFireucLinux

2009-03-11 Thread Michael Schnell



In general, it's a "hack" to drive real interactive programs like `ftp'
and `telnet' from pipes. 

Why do you think so ?

The question is "what is feeding the pipe" ?

You should be able to do a simple program that sends the characters to 
the pipe using the appropriate timing and pipe same to telnet using msh.


-Michael


___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] ( subshell ) |telnet--> not workingon WildFireucLinux

2009-03-12 Thread Enrik Berkhan
On Wed, Mar 11, 2009 at 09:38:04AM +0100, Michael Schnell wrote:
>> In general, it's a "hack" to drive real interactive programs like `ftp'
>> and `telnet' from pipes. 
> Why do you think so ?

You don't get really reliable results without a `chat' type driver.
That needs a bi-directional pipe and that's why programs like `expect'
use at pty.

Of course, it works most of the time and often you have no choice due
to the lack of alternatives. That's what I'd call a hack in this context :)

Enrik
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev