Computing.Net > Forums > Unix > for loop in ssh

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

for loop in ssh

Reply to Message Icon

Name: pdm280
Date: November 18, 2008 at 03:25:05 Pacific
OS: Solaris 9
CPU/Ram: Sun V440
Comment:

Hi, I am trying to gather some mount point permissions from a remote system. I am having trouble with the for loop as it seems to exit the ssh and run on the local system instead. Using ksh.

su - remotesh -c "ssh server df -h | grep dsk | grep -v bootdg | awk ' { print \$6 } ' | for i in \` cat \` ; do ls -ld \$i ; done "

And the output I get is:
/dirname: No such file or directory

... as the for loop is running on the local system not the remote system.
I'm sure I have to use parenthesis or single quotes somewhere but cannot work it out...



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: for loop in ssh

problem with grep in a for loop www.computing.net/answers/unix/problem-with-grep-in-a-for-loop/3967.html

loops in shell scripts!!! www.computing.net/answers/unix/loops-in-shell-scripts/5140.html

For Loop Iteration www.computing.net/answers/unix/for-loop-iteration/7267.html