The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 10-13-2008
hcclnoodles hcclnoodles is offline
Registered User
  
 

Join Date: Mar 2002
Posts: 272
I tried the double quote option and I got this


Code:
# rsh remote-server "df -k | grep sd | grep -v boot | awk '{print $3}'"
/dev/sda3              8254272   1672772   6162204  22% /
/dev/sdb4            140258988  12922912 120211252  10% /data_store
/dev/sda4            123648020     32828 117334180   1% /data_store1

i.e. it didnt print column 3 on its own!

Quote:
Originally Posted by rubin View Post
Or maybe this might help,


Code:
rsh remote-server <<'EOF'

   df -k | awk '/sd/ && !/boot/ { print $3 }'

EOF

... And awk has its own search capabilities.


unfortunately I got this


Code:
# rsh remote-server <<'EOF'
> df -k | awk '/sd/ && !/boot/ { print $3 }'
> EOF
tcgetattr: Inappropriate ioctl for device
ioctl I_FIND ttcompat: Inappropriate ioctl for device


any other suggestions ?

Last edited by hcclnoodles; 10-13-2008 at 06:21 AM..