Operating System - HP-UX
1752805 Members
5666 Online
108789 Solutions
New Discussion юеВ

shell assignment doesn't work

 
SOLVED
Go to solution
andi_1
Frequent Advisor

shell assignment doesn't work

Hi guys,

mountPoint="/mnt_simple"

Does anyone know why the following line doesn't work?
myFstyp=`mount -p | grep "$mountPoint " | awk '{print $3}'`

echo "fstype = $myFstyp" # doesn't display anything

While, if I execute the above line on the command prompt, it works fine....

Any ideas?

Thanks a lot!
5 REPLIES 5
S.K. Chan
Honored Contributor
Solution

Re: shell assignment doesn't work

Why don;t just use the command ..
# fstyp /dev/vg00/lvol1
for the FS mounted from /dev/vg00/lvol1 for instance.

just a thought ..
Christopher McCray_1
Honored Contributor

Re: shell assignment doesn't work

Hello,

From what you are saying, it sounds like you are running this out of cron or something.

at the top of your script:

PATH=/usr/bin:/sbin:/usr/sbin
export PATH

or state the absolut path of every command you execute.

Hope I understood you correctly

Chris
It wasn't me!!!!
PIYUSH D. PATEL
Honored Contributor

Re: shell assignment doesn't work

Hi,

mountPoint="/mnt_simple"
export mountPoint

myFstyp=`/sbin/mount -p | grep "$mountPoint " | awk '{print $3}'`


Piyush



MANOJ SRIVASTAVA
Honored Contributor

Re: shell assignment doesn't work

Hi Lz

try this
mountPoint="/mnt_simple"
export myFstyp=`/usr/sbin/mount -p | grep "$mountPoint " | awk '{print $3}'`

This should the the parameter correctly



Manoj Srivastava







harry d brown jr
Honored Contributor

Re: shell assignment doesn't work

lz,

Like they have said, use fstyp.

BUT, I tried your example (with a different mount point) and it works fine.

what does:

mount -p | grep "$mountPoint " | od -bc

return??

live free or die
harry
Live Free or Die