<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: howto exclude in a loop in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/howto-exclude-in-a-loop/m-p/5080711#M92526</link>
    <description>ok checked out and tested.&lt;BR /&gt;&lt;BR /&gt;Thanks for the advice.&lt;BR /&gt;&lt;BR /&gt;Chris</description>
    <pubDate>Wed, 21 Nov 2007 10:22:41 GMT</pubDate>
    <dc:creator>lawrenzo_1</dc:creator>
    <dc:date>2007-11-21T10:22:41Z</dc:date>
    <item>
      <title>howto exclude in a loop</title>
      <link>https://community.hpe.com/t5/operating-system-linux/howto-exclude-in-a-loop/m-p/5080707#M92522</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I want to umount a set of filesystems on various systems except VG00 filesystems and an NFS mount.&lt;BR /&gt;&lt;BR /&gt;I have attempted a for and while loop for this with no success.&lt;BR /&gt;&lt;BR /&gt;I created a file with the mountpoints I want remaining mounted then put this into a while loop:&lt;BR /&gt;&lt;BR /&gt;while read MOUNT&lt;BR /&gt;do&lt;BR /&gt;for FS in `df|awk 'NR&amp;gt;1 {print $6}'`&lt;BR /&gt;do&lt;BR /&gt;if [ $FS = $MOUNT ] ; then&lt;BR /&gt;etc&lt;BR /&gt;etc&lt;BR /&gt;&lt;BR /&gt;this doesnt work and am struggling to come up with something suitable.&lt;BR /&gt;&lt;BR /&gt;any ideas?&lt;BR /&gt;&lt;BR /&gt;thanks in advance.&lt;BR /&gt;&lt;BR /&gt;chris.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Nov 2007 09:39:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/howto-exclude-in-a-loop/m-p/5080707#M92522</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2007-11-21T09:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: howto exclude in a loop</title>
      <link>https://community.hpe.com/t5/operating-system-linux/howto-exclude-in-a-loop/m-p/5080708#M92523</link>
      <description>You could use your "for FS in" as your outer loop.&lt;BR /&gt;Then pipe the output to grep:&lt;BR /&gt;for FS in $(df|awk 'NR&amp;gt;1 {print $6}') | fgrep -xvf mount-exclude-file); do&lt;BR /&gt;&lt;BR /&gt;You would have to be careful if the files in mount-exclude-file are proper substrings of any other mount point.  I think -x will cause "/" to not match any other mount point.</description>
      <pubDate>Wed, 21 Nov 2007 09:47:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/howto-exclude-in-a-loop/m-p/5080708#M92523</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-11-21T09:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: howto exclude in a loop</title>
      <link>https://community.hpe.com/t5/operating-system-linux/howto-exclude-in-a-loop/m-p/5080709#M92524</link>
      <description>Greetings,&lt;BR /&gt;&lt;BR /&gt;Why dont you try with another reasoning:&lt;BR /&gt;create your MOUNT file by doing a&lt;BR /&gt;bdf|grep -v vg00 (and whatever needs to stay mounted...) to extract your filesystems to unmount?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;All the best&lt;BR /&gt;Victor</description>
      <pubDate>Wed, 21 Nov 2007 09:49:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/howto-exclude-in-a-loop/m-p/5080709#M92524</guid>
      <dc:creator>Victor BERRIDGE</dc:creator>
      <dc:date>2007-11-21T09:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: howto exclude in a loop</title>
      <link>https://community.hpe.com/t5/operating-system-linux/howto-exclude-in-a-loop/m-p/5080710#M92525</link>
      <description>&lt;!--!*#--&gt;Hi Chris:&lt;BR /&gt;&lt;BR /&gt;To conditionally skip a step in your loop and begin again at it's top you can use 'continue'.&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;df | while read FS X&lt;BR /&gt;do&lt;BR /&gt;    if [ "${FS}" = /tmp ];then&lt;BR /&gt;        continue&lt;BR /&gt;    else&lt;BR /&gt;        echo ${FS}&lt;BR /&gt;    fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;If you want to exit the loop at any time, use 'break'.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 21 Nov 2007 09:50:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/howto-exclude-in-a-loop/m-p/5080710#M92525</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-11-21T09:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: howto exclude in a loop</title>
      <link>https://community.hpe.com/t5/operating-system-linux/howto-exclude-in-a-loop/m-p/5080711#M92526</link>
      <description>ok checked out and tested.&lt;BR /&gt;&lt;BR /&gt;Thanks for the advice.&lt;BR /&gt;&lt;BR /&gt;Chris</description>
      <pubDate>Wed, 21 Nov 2007 10:22:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/howto-exclude-in-a-loop/m-p/5080711#M92526</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2007-11-21T10:22:41Z</dc:date>
    </item>
  </channel>
</rss>

