Pages

Wednesday, July 13, 2011

Error: [: = unary operator expected

# Remove all shared memory segment
ipcs -m |\
while read key shmid owner perms bytes nattch status
do
if [ $owner = $USER ]
then
echo -e "\t removing shared memory segment \"$shmid\"" 1>&2
ipcrm -m $shmid
fi
done

Error:

rmShm.sh: line 13: [: =: unary operator expected
removing shared memory segment "55443496"
rmShm.sh: line 13: [: =: unary operator expected


Fix:
if [ "$owner" = "$USER" ]

No comments:

Post a Comment