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
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...
Summary: Hi, I am having a problem with grep while using it in a for loop. I have a file "ab" that looks like : (start file) --comment 1 -- comment 2 hghj jh abc bht nef 987 bht pit --comment 3 890 gyu ppp 456...
Summary: Hi, I'm trying to run loops in shell scripts using the following script. loop=1 while [ loop -lt 10 ] do echo 'this is my $loop text-line' loop='expr $loop + 1' done ---- but I'm getting error: test: ...
Summary: I am creating a script in which I have to note down the size of the files which are in different directory. Suppose:- In log dir : A1.txt A2.txt A3.txt A4.txt and in dat directory" A4.txt A5.txt A6.tx...