Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 24 Apr 2014, 04:45
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Script tests if a file system is mounted. (SOLVED)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [3 Posts]  
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 4985
Location: Arizona, U.S.A.

PostPosted: Sun 27 Nov 2005, 03:15    Post subject:  Script tests if a file system is mounted. (SOLVED)  

This code chunk gets the IP add., I'm trying to modify it.

MYIP=`ifconfig |grep "Bcast"| sed "s/^.*addr://" | sed "s/\w.*//"`
--------
This code checks the mount print out to see if a certain file system is mounted.
Error, first sed at char. 23, unknown command: `/'.

MNTFS=`mount |grep "on"| sed "/^\/\/160SEA\/PUPPYPC//" | sed "s/ //"`
----------
Bottom part of the the mount display, the part searched for is: //160SEA/PUPPYPC.

//160SEA/public on /mnt/public type smbfs (rw,nosuid,nodev,win95,file_mode=0755,dir_mode=0755)
//160SEA/docs on /mnt/docs type smbfs (ro,nosuid,nodev,win95,file_mode=0755,dir_mode=0755)
//160SEA/PUPPYPC on /home type smbfs (rw,nosuid,nodev,win95,file_mode=0755,dir_mode=0755)

Is there an easier way to do it? One would only hope!

Last edited by sunburnt on Sun 27 Nov 2005, 17:19; edited 1 time in total
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Sun 27 Nov 2005, 07:52    Post subject:  

sed might be confused by the "/" in the foldernames.

Sed can use different delimters like "#"
MNTFS=`mount |grep "on"| sed "#^//160SEA/PUPPYPC##" | sed "s# ##"`

You also can use "." instead of "/".
"." means "one char of whatever type".
MNTFS=`mount |grep "on"| sed "#^..160SEA.PUPPYPC##" | sed "s# ##"`

Mark
Back to top
View user's profile Send private message Visit poster's website 
sunburnt


Joined: 08 Jun 2005
Posts: 4985
Location: Arizona, U.S.A.

PostPosted: Sun 27 Nov 2005, 17:32    Post subject:  

Thanks MU, I saw the . usage, but didn't think to use it in place of the 23 char. that was causing the problem.
This is what I needed, lots & lots of examples, your a scholar & a gentleman.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [3 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0684s ][ Queries: 12 (0.0364s) ][ GZIP on ]