OSX - Running a script

  • Thread starter Thread starter Deleted member 49549
  • Start date Start date
D

Deleted member 49549

Guest
I need to uninstall a package and have been given the following instructions

Run this script in a terminal:

#!/bin/sh -x

#This script removes Mono from an OS X System. It must be run as root

rm -r /Library/Frameworks/Mono.framework

rm -r /Library/Receipts/MonoFramework-*

for dir in /usr/bin /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man5; do
(cd ${dir};
for i in `ls -al | grep /Library/Frameworks/Mono.framework/ | awk '{print $9}'`; do
rm ${i}
done);
done

How is this run?
 
Go to finder type terminal. Open terminal, paste and click enter. It will ask you for your password. Type the password and click ok.

There terminal app should be until utilities.
 
Sorry should say I don't know what the script is doing so make sure you have a backup.
 
Sorry should say I don't know what the script is doing so make sure you have a backup.

It:

  • Removes all files in /Library/Frameworks/Mono.framework
  • Removes all files in directories beginning with /Library/Receipts/MonoFramework-

It is also supposed to remove all files that have /Library/Frameworks/Mono.framework/ as part of their filename in /usr/bin and the manual page directories, but it depends on how OS-X interprets the ls command (my version of FreeBSD - which OS-X is based on - doesn't descend in the directories so the complex line will do nothing on my system).

It will delete some files, but won't do anything nasty (unless you didn't want the files deleted of course!!).

Also, not sure how OS-X handles running as root - on most linux systems you use "sudo"....
 
Chances are sudo will need to be used, even on an Admin account.
 
Cheers all,

i shall be dong it after work, so may be back with questions!
 
Back
Top