Operating System - HP-UX
1833187 Members
2998 Online
110051 Solutions
New Discussion

Re: ls command doesn't work properly when I connect to a remote machine

 
Consuelo Sierra
Occasional Contributor

ls command doesn't work properly when I connect to a remote machine

When I connect to a remote machine by means of rlogin and I do a 'ls' of a directory with a lot of files, the result of the command is interrupted and I don't get all the files. If I connect to the remote machine by means of telnet instead of rlogin I get the result correctily. Anyone of you knows why happens this? and Anyone knows the reason why the ls command is interrupted?
konsu
5 REPLIES 5
harry d brown jr
Honored Contributor

Re: ls command doesn't work properly when I connect to a remote machine


What are you rlogin'ing from (OS, release, etc..) and rlogin'ing to (OS, release, etc...)??

live free or die
harry
Live Free or Die
Bill McNAMARA_1
Honored Contributor

Re: ls command doesn't work properly when I connect to a remote machine

corrupted filesystem?
strange character filenames - are you piping through more?

remsh hostname -n "ls -la /tmp"

Later,
Bill
It works for me (tm)
Sanjay_6
Honored Contributor

Re: ls command doesn't work properly when I connect to a remote machine

Hi,

What do you men by interrupted ?. Check your TERM setting when you do a rlogin. Your .profile on the remote system is not executed when you do a rlogin, but it is executed when you do a telnet.

So check the environment variables like "TERM" etc on the remote system after doing a rlogin.

Hope this helps.

Regds
Steve Steel
Honored Contributor

Re: ls command doesn't work properly when I connect to a remote machine

Hi

try using the -n option.

From man page

By default, remsh reads its standard input and sends it to the remote command because remsh has no way to determine whether the remote command requires input. The -n option redirects standard input to remsh from /dev/null.
This is useful when running a shell script containing a remsh command, since otherwise remsh may use input not intended for it. The -n option is also useful when running remsh in the background from a job control shell, /usr/bin/csh or /usr/bin/ksh.
Otherwise, remsh stops and waits for input from the terminal keyboard
for the remote command. /usr/bin/sh automatically redirects its input
from /dev/null when jobs are run in the background.



Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Krishna Prasad
Trusted Contributor

Re: ls command doesn't work properly when I connect to a remote machine

I have only seen this when I also do | more at the end of the ls then scroll down the listing.

Are you using piping the output to the screen after the ls?
Positive Results requires Positive Thinking