Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Edison was a dick
Apr 3, 2010

direct current :roboluv: only

LoonShia posted:

What does it do?

Complain about a syntax error because of the capitalisation, and that he's used square brackets to create a list.
Fixed and rendered more readably this would be:

code:
nohup /bin/bash -c '
  WORDS=(
    "PLEASE HELP ME"
    "I AM SO ALONE"
    "TO ARMS MY BROTHERS"
    "ONE OF US ONE OF US"
    "PSSSSST"
    "HEY LISTEN."
    "DEATH TO ALL"
    "THE HUNGER IS OVERWHELMING"
    "OVER HERE"
    "DONT EVER LEAVE ME"
    "DUCK DUCK GOOSE"
  )
  while [ 1 = 1 ]; do
    osascript -e "set volume 9"
    say "${WORDS[$( $(( RANDOM % ${#WORDS[@]} )) )]}" \
      -v whisper -R 1.5
    sleep 30
  done
' &
Note, he couldn't put an appostrophe in the DONT, because he'd have to enter it as '\'', which is really ugly and detract from the point more than it already does.

/bin/bash -c '...' means run the commands in the quoted text in a subshell.
The nohup before it means that you don't close the program when you close your terminal. The & at the end means run it in the background, which isn't strictly necessary, it just means you can use your terminal for something else in the mean-time.
words=( ... ) means create an array containing that data, which is later used to look up a random entry.
[ 1 = 1 ] is a stupid way of defining a command that does nothing except exit successfully, which you could replace with the word true.
You need a command that always exits successfully so that you can do an infinite loop, which is what the while [ 1 = 1 ]; do ... done does.

"${WORDS[$( $(( RANDOM % ${#WORDS[@]} )) )]}" is a real pain to break down, I'll go inside out.
${#WORDS[@]} means get the length of the words array. You use ${WORDS[@]} to get the whole array, and put a # before the array name to say that you want the length instead.
I took some liberties in the translation. Next up is the $(( RANDOM % array_length )), which was literally $[ RANDOM % array_length ] in the example, but it's recommended to use $(( )) instead of $[ ] these days.
What it does is to get a random number, by way of the magic $RANDOM variable, then use modulo arithmetic (%, think of it like the remainder after division) to get a random number in the range 0..(array_length -1)
This is used to get a random entry from the array by way of the subscript operator again. You previously saw ${WORDS[@]}, which gets you the whole array, but instead of the @ symbol, you can put a number, which gives you that entry in the array, starting from 0.
The random sentence is passed to the say command, which I assume speaks the words out. -v whisper presumably makes it speak it out as a whisper, and -R 1.5 makes it slow the speech down by a factor of 1.5.
The sleep 30 command makes it wait for 30 seconds before continuing.
The result being it speaks out a creepy phrase on your speakers every 30 seconds.

I'd expect that an Apple Genius wouldn't understand it, probably attempting to turn it off and on again, which would fix this, because they haven't put the command somewhere that would make it be run on start-up.

If they did think to see what commands are running, I doubt they would be able to decipher exactly what's going on, since to decipher that shell script you need to be a Unix beard.

Adbot
ADBOT LOVES YOU

Frostwerks
Sep 24, 2007

by Lowtax
Um.

Edison was a dick
Apr 3, 2010

direct current :roboluv: only

This poo poo's part of my job, and someone did ask.

SatansBestBuddy
Sep 26, 2010

by FactsAreUseless

Edison was a dick posted:

This poo poo's part of my job, and someone did ask.

But can you make it funny?

Thump!
Nov 25, 2007

Look, fat, here's the fact, Kulak!



SatansBestBuddy posted:

But can you make it funny?

Being unfunny is a meme :colbert:

PCOS Bill
May 12, 2013

by FactsAreUseless

Thump! posted:

Being unfunny is a meme :colbert:

It might be a meme to you, buddy, but it's life to me.

Roar
Jul 7, 2007

I got 30 points!

I GOT 30 POINTS!
Memes are life

embrace nothingness

CobiWann
Oct 21, 2009

Have fun!

Mans
Sep 14, 2011

by Jeffrey of YOSPOS

Karate Bastard
Jul 31, 2007

Soiled Meat

SatansBestBuddy posted:

But can you make it funny?

He does this for a living. Isn't that funny to you? Hahahahahakill me

e: he's also dumb its -r not -R killmekillmekillme

e2: vvvvvv this guy gets it.

Karate Bastard has a new favorite as of 22:29 on Mar 15, 2015

Data Graham
Dec 28, 2009

📈📊🍪😋



Karate Bastard posted:

He does this for a living. Isn't that funny to you? Hahahahahakill me

e: he's also dumb its -r not -R killmekillmekillme

Neddy Seagoon
Oct 12, 2012

"Hi Everybody!"

Wow Rodney Dangerfield got fat towards the end.

Sally
Jan 9, 2007


Don't post Small Dash!
these are pretty good. guy takes urban kids on nature hikes and writes down what they say: http://www.dumpaday.com/random-pictures/funny-pictures/guy-writes-down-things-urban-kids-said-when-he-takes-them-on-a-nature-hike-18-pics/

Kheldarn
Feb 17, 2011



Taciturn Tactician
Jan 27, 2011

The secret to good health is a balanced diet and unstable healing radiation
Lipstick Apathy

I'm a programmer and even I don't care about reading all this poo poo you posted.

Everything Counts
Oct 10, 2012

Don't "shhh!" me, you rich bastard!

Gonna be that guy and point out that these are fake.

rydiafan
Mar 17, 2009



Edison was a dick posted:

I'd expect that an Apple Genius wouldn't understand it, probably attempting to turn it off and on again, which would fix this, because they haven't put the command somewhere that would make it be run on start-up.

So how would you make it run on start-up, smart guy?

RonMexicosPitbull
Feb 28, 2012

by Ralp

Everything Counts posted:

Gonna be that guy and point out that these are fake.

Well yea I dont think you can really take pictures of sounds and white letters dont really just appear of nowhere. They're likely shopped in my opinion.

Sally
Jan 9, 2007


Don't post Small Dash!

Everything Counts posted:

Gonna be that guy and point out that these are fake.

sheeeit. well, i'd rather know. thanks.

The Mighty Moltres
Dec 21, 2012

Come! We must fly!


Karate Bastard posted:

Double penetration poop hole

Bloody Hedgehog
Dec 12, 2003

💥💥🤯💥💥
Gotta nuke something
Dreidels, Penetrating Pussies? HARAAM!

Say Nothing
Mar 5, 2013

by FactsAreUseless

AtomD
May 3, 2009

Fun Shoe

Kanfy posted:

Calling human genitalia funny names is a pretty ancient and beloved tradition and I suspect you might be reading too much into this.

I will do my bit for equality by making up some equally unappetizing words for male genitalia:
Blood Baloon
Cumspout
Elephantiasis Clit
Piss-liver

E: gently caress tendril

AtomD has a new favorite as of 10:28 on Mar 16, 2015

Karate Bastard
Jul 31, 2007

Soiled Meat
Nasty :thumbsup:

Hydrolith
Oct 30, 2009

Bloody Hedgehog posted:

Dreidels, Penetrating Pussies? HARAAM!

Kosher though!

The Mighty Moltres
Dec 21, 2012

Come! We must fly!


AtomD posted:

I will do my bit for equality by making up some equally unappetizing words for male genitalia:
Blood Baloon
Cumspout
Elephantiasis Clit
Piss-liver

If I were gay, I would call mine "The Widowmaker"

Edison was a dick
Apr 3, 2010

direct current :roboluv: only

rydiafan posted:

So how would you make it run on start-up, smart guy?

:shrug: I'm not an OSX hipster, the most I know is you register it with launchd, probably putting a file in ~/Library/LaunchAgents, in launchd.plist format.

PCOS Bill
May 12, 2013

by FactsAreUseless

AtomD posted:

I will do my bit for equality by making up some equally unappetizing words for male genitalia:
Blood Baloon
Cumspout
Elephantiasis Clit
Piss-liver

Clam Hammer

Paladinus
Jan 11, 2014

heyHEYYYY!!!

Everything Counts posted:

Gonna be that guy and point out that these are fake.

Unbelievable. How many people were fooled by these fake memes? How many lives have been ruined?
Meme forgery should be a criminal offence, imo. We can stop fake memes together.

Son of Thunderbeast
Sep 21, 2002

Paladinus posted:

How many people were fooled by these fake memes?

I can take this one: a lot of them, as long as they were racist and/or had zero exposure to black people

Data Graham
Dec 28, 2009

📈📊🍪😋



Black kids totally say "mista" you guys.

Son of Thunderbeast
Sep 21, 2002

Data Graham posted:

Black kids totally say "mista" you guys.

They read like Stephen King trying to write a black character. lawdy lawdy

Zzulu
May 15, 2009

(▰˘v˘▰)

this is so obviously written by some white dork

Pyrolocutus
Feb 5, 2005
Shape of Flame



Zzulu posted:

this is so obviously written by some white dork racist

Fixed that for you.

Karma Monkey
Sep 6, 2005

I MAKE BAD POSTING DECISIONS

Son of Thunderbeast posted:

They read like Stephen King trying to write a black character. lawdy lawdy

No because there's no reference in the gifs to the urban kids having special powers that saved the adult white guy from a supernatural evil lurking in the forest.

Dooky Dingo
Feb 17, 2011

Gym badge day is a VERY dangerous day!

Karma Monkey posted:

No because there's no reference in the gifs to the urban kids having special powers that saved the adult white guy from a supernatural evil lurking in the forest.

Or pre-teen gangbangs.
Mr. King, Chris Hanson would like a word or two with you about "IT". :colbert:

ThaGhettoJew
Jul 4, 2003

The world is a ghetto

Paladinus posted:

Unbelievable. How many people were fooled by these fake memes? How many lives have been ruined?
Meme forgery should be a criminal offence, imo. We can stop fake memes together.

Mans
Sep 14, 2011

by Jeffrey of YOSPOS

Say Nothing
Mar 5, 2013

by FactsAreUseless

Adbot
ADBOT LOVES YOU

CobiWann
Oct 21, 2009

Have fun!

  • Locked thread