From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nico -telmich- Schottelius Date: Wed, 04 May 2005 17:51:36 +0000 Subject: Re: Finding sysfs mount point Message-Id: <20050504175136.GF2082@schottelius.org> MIME-Version: 1 Content-Type: multipart/mixed; boundary="3yNHWXBV/QO9xKNm" List-Id: References: In-Reply-To: To: linux-hotplug@vger.kernel.org --3yNHWXBV/QO9xKNm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Christian Borntr?ger [Fri, Apr 29, 2005 at 09:09:47AM +0200]: > On Friday 29 April 2005 06:48, Greg KH wrote: > > cat /proc/mounts | grep sysfs | cut -f 2 -d " " >=20 > if sysfs is mounted several times, this results in a non useful value for= =20 > scripting. what about >=20 > cat /proc/mounts | grep -m 1 sysfs | cut -f 2 -d " " >=20 > to get the first available mountpoint? None of those expamples is reliable, when other paths contain 'sysfs'. Simply use awk for it, it's build for such things: awk '$3 ~ /sysfs/ { print $2; exit }' /proc/mounts This will catch wrong sysfs mounts and also display only the first match. Nico --=20 Keep it simple & stupid, use what's available. Please use pgp encryption: 8D0E 27A4 is my id. http://nico.schotteli.us | http://linux.schottelius.org --3yNHWXBV/QO9xKNm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iQIVAwUBQnkLp7OTBMvCUbrlAQJGOA/+MVELLsm6yH/h+GQYGb3qB9NEfmt2Mnxv gpD/g9JxPUdwNgVmRMzR/dajKCLPb4w+CSc0wK4dqvNS6W0VcUYA1bJMqXNsc9qQ X2WD7yZmKLoGVDSrdA5+fEzViEFD3DX2LLmqfER9k/dfeBvuusH6bt7StviUug6E KTH1+kl9WZnKPbVZIocT054b5SlK+qSs9XPcdKIhZhl57Pu8R/aEUnebwLVJOxaK Cy7ORVT4DN8dzpGbTxWdElDjo3zz2o4SjyClRkYtn+8wIgRB8kvzSKhSdY4raBI4 5ZbLB2/+uu3xaZExNr0KJjsvxfVlk3TuXmOEDlOK+V5/Fr2eJfqxRc0vAY8ds0O/ atpwhRUCqFPlQ7Rdhy0ldK55hBSKufHldSduukQNKtVQJKUVbFpsEVe7YKeaOhvx RViOGL3dyWpyF+Qt/w4X5pVgjkI2lrMLLNRTo0RsvtHnoeDLSCsTkIkhaV+jNgjW fFSDP+XwPUCA6nNBXroAOXyBxcRn4C4kg4MNJUxpKmhKlR+B4N2aETPpx/ovEcSF jRU4trPW6a6t7H85MNyqvt9P5TKJSpvZpwDvdJHwEu9zD8+BG6pehR///dwoHIB4 JY9vdK2ozDJbpGWpED8fDfiqqL4C0Z1gdgPWUk2wQOa1Y5jwl9ib63OEup664Vac Uz9xuruHga8= =ffUo -----END PGP SIGNATURE----- --3yNHWXBV/QO9xKNm-- ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel