How can I keep 'lsregister' away from partitions?

I've used 'lsregister' to -kill an old output, and then build a new one, like this:


myapp=$(find /System/Library/Frameworks -name lsregister)

$myapp -kill

$myapp -dump "/Volumes/Mac.HD" >$HOME/lsreg.txt

$myapp -dump "/Applications" >>$HOME/lsreg.txt


But the output contains entries for my /Volumes/Alternate.HD, which I don't want, and didn't ask to get. Is there some option that will suppress going down the /Volumes-tree? It also picks up any externally mounted volumes.

Posted on Oct 29, 2017 8:25 PM

Reply
Question marked as Top-ranking reply

Posted on Oct 30, 2017 9:10 AM

I found the following works for me!


#!/bin/bash

myapp=$(find /System/Library/Frameworks -name lsregister)

if [ -z "$myapp" ]; then

echo "isregister not found."

else

bootdisk=$(ls -l /Volumes | grep '> ' | sed 's, -> /,,' | awk '{$1=$2=$3=$4=$5=$6=$7=$8="";print $0}' | xargs)

$myapp -kill

$myapp -seed "/Volumes/$bootdisk"

$myapp -dump >$HOME/lsreg.txt

echo "Created $HOME/lsreg.txt from $bootdisk"

fi

exit 0

6 replies
Question marked as Top-ranking reply

Oct 30, 2017 9:10 AM in response to PN2

I found the following works for me!


#!/bin/bash

myapp=$(find /System/Library/Frameworks -name lsregister)

if [ -z "$myapp" ]; then

echo "isregister not found."

else

bootdisk=$(ls -l /Volumes | grep '> ' | sed 's, -> /,,' | awk '{$1=$2=$3=$4=$5=$6=$7=$8="";print $0}' | xargs)

$myapp -kill

$myapp -seed "/Volumes/$bootdisk"

$myapp -dump >$HOME/lsreg.txt

echo "Created $HOME/lsreg.txt from $bootdisk"

fi

exit 0

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can I keep 'lsregister' away from partitions?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.