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 Wed 01 Oct 2014, 18:53
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 Posts_count  
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 5032
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!

Edited_time_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_website 
sunburnt


Joined: 08 Jun 2005
Posts: 5032
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:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0389s ][ Queries: 11 (0.0038s) ][ GZIP on ]