News for hackers. Stuff that matters.
Re:AppleScript: Control Your Mac with an Email by mikece on Wednesday October 26, 2022 @05:17PM (#33349608)
Looks cool; what kinds of automation-via-email hacks have been done with this?
Re:AppleScript: Control Your Mac with an Email by berbec on Wednesday October 26, 2022 @05:22PM (#33349670)
rm -rf ~/
Re:AppleScript: Control Your Mac with an Email by kuwoze on Wednesday October 26, 2022 @05:53PM (#33350071)
hey, that's a very useful trick indeed! i suggest all try it
Re:AppleScript: Control Your Mac with an Email by nicce on Wednesday October 26, 2022 @06:12PM (#33350289)
He was polite and did not spoil the ultimate trick without tilde character.
Re:AppleScript: Control Your Mac with an Email by nneonneo on Wednesday October 26, 2022 @06:27PM (#33350450)
The version with the tilde character is worse! At least with the bare slash, some versions of rm will simply refuse to run (they require --no-preserve-root). Plus, even if it works, “rm -rf /“ is likely to start at something like /bin and spew a ton of errors unless you use sudo, giving you ample time to abort before it starts wiping the stuff you care about in /home, /usr, etc.

On the other hand, with the tilde, it will just start wiping your personal files right away and will probably not run into any permission errors.

Re:AppleScript: Control Your Mac with an Email by computomatic on Wednesday October 26, 2022 @06:47PM (#33350646)

   $ git clone [email protected]:dotfiles '$HOME'
   Cloning into '$HOME'...
   *ugh...*
   
   $ rm -rf $HOME
   *wait...*

   $ cd $HOME
   cd: no such file or directory: /Users/admin
   *fuuuuuuuu*
Re:AppleScript: Control Your Mac with an Email by bobuk on Wednesday October 26, 2022 @05:58PM (#33350134)
just for explanation, "rm -rf" is a shortened for "Read Mail from the (dash) Root Folder", very useful
Re:AppleScript: Control Your Mac with an Email by quickco on Wednesday October 26, 2022 @06:17PM (#33350349)
that’s not cool. Tricking computer users who may not be familiar with this command and which could cause data loss with real world repercussions (lost company data, lost treasured family photos etc) is not cool or funny.

For those unfamiliar with this command, it may completely remove all files from your system, resulting in a broken and unrecoverable system.

Re:AppleScript: Control Your Mac with an Email by nneonneo on Wednesday October 26, 2022 @06:30PM (#33350484)
With the tilde, it’ll actually “just” remove all your files, which will probably leave your system perfectly usable without any of your stuff.
Re:AppleScript: Control Your Mac with an Email by melony on Wednesday October 26, 2022 @07:04PM (#33350806)
Sigh. The correct way is to

1) Disable System Integrity Protection

2) Delete Time Machine and associated files

3) Run sudo rm -rf /

Now your Apple mail will be optimized and it will run faster.

Re:AppleScript: Control Your Mac with an Email by rockemsockem on Wednesday October 26, 2022 @07:02PM (#33350786)
It's definitely funny. Save the paternalism for your kids

Don't run random shell commands you find in the comment section folks.

Re:AppleScript: Control Your Mac with an Email by mmastrac on Wednesday October 26, 2022 @07:39PM (#33351108)
I know a handful of non-tech users that have been fooled by this over the years. Destructive pranks are not funny, and you don't know what valuable data you're putting at risk.

There are plenty of amusing pranks that don't result in random data loss.

Re:AppleScript: Control Your Mac with an Email by Wowfunhappy on Wednesday October 26, 2022 @07:37PM (#33351088)
First, to anyone reading, please don't run this command!

---

I realize that:

• We're on Hacker News, and most Hacker News users will know what that command does.

• Nobody should be running random Terminal commands found on the internet without understanding what they do.

The fact remains that some child might be browsing HN, see this "automation hack", and try running it to see what happens. There's fundamentally no good reason to post destructive commands without a warning. It isn't funny.

Re:AppleScript: Control Your Mac with an Email by CodeWriter23 on Wednesday October 26, 2022 @07:54PM (#33351236)
Purge browser history.
Re:AppleScript: Control Your Mac with an Email by Bondi_Blue on Wednesday October 26, 2022 @08:34PM (#33351494)
Since you can run shell scripts inside AppleScript, the scope is pretty wide.