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!
Script tests if a file system is mounted. (SOLVED)
Script tests if a file system is mounted. (SOLVED)
Last edited by sunburnt on Sun 27 Nov 2005, 21:19, edited 1 time in total.
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
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