Basename e Dirname
Colaboração: Rubens Queiroz de Almeida
Data de Publicação: 28 de Junho de 1997
Dois comandos que permitem a manipulação de nomes e caminhos de arquivos
dentro de sistemas Unix são os comandos "basename" e "dirname".
O comando basename irá retirar o último nome após o último "/"
como exemplificado abaixo:
% basename /usr/local/bin/gzip
Ou seja, este comando pode ser utilizado para extrair apenas o nome
de um arquivo a partir do caminho completo, neste caso, o nome gzip.
Já o comando dirname retorna como resultado o caminho inteiro fornecido
à exceção do último nome, como exemplificado abaixo:
% dirname /usr/local/bin/gzip
Dica Humorística :-)
Fit the First: (Genesis) Striped Irregular Bucket #1
Bastard Operator From
Updated: Tuesday 14 November 1995
BOFH © 1990-1995 by Simon Travaglia and Datamation. All rights reserved.
I'm really bored. You know how bored you get when work's going on and on and
on, and nothing interesting is happening, and you're listening to a radio
that picks up ONE station on FM, and it's always the station with the least
records in the city, about 5, and one of them is "You're so Vain" which
wasn't too bad a song until you hear it about 3 times a day for a year, and
*EVERY* time it plays, the announcer tells you it's about Warren Beaty and
who he's currently poking, someone you'll never sniff the toe-jam of, let
alone meet, let alone get amourous with. And EVERY time someone mentions
Warren Beaty, someone says that he used to go out with Madonna too, and have
you seen "In Bed With.."
AND THEN, someone ELSE will say "It wasn't really about Warren Beaty, it was
James Taylor" and the first person will say "What, `In bed with Madonna?'",
and they laugh and everyone else laughs, and I slip out the Magnum from
under the desk where I keep it in case someone laughs at a joke that's so
dry it's got a built in water-fountain, and blow the lot of them away as a
community Service. I figure that I'll get time off my sentence if I ever
kill someone by accident who's got a life.
So visitors are getting pretty thin at the moment, and the Quick-Lime Pits
are filling up rapidly, and all I've got to do is the full backups and maybe
I can go home.
So, to relieve the boredom, I get some iron filings and pour them into the
back of my Terminal until it fizzes out (Which doesn't take all that long,
surprisingly enough), then call our maintenance contractors and log a fault
on the device. Sometimes they'll send someone who knows what they're doing,
but it's a lot more fun when they don't - which is about 98% of the time.
So they maintenance guy comes in, and I can tell he's NEW because the photo
on his ID actually LOOKS like him, not like the head engineer, whose photo's
a black and white tin-type (he's that old).
Maintenance Contractors always dress up nice, with a tie and everything
because they believe that a customer will trust a nicely dressed guy with
their million dollar equipment *just* because he's got a nice tie..
Because he's NEW and ALONE, he's what you call an appeasement engineer, the
new guy they send so they respond within the 4 hour guaranteed response
period. (Things are getting better and better) Your average appeasement
engineer is about as clued-up on computers as the average computer "hacker"
is about B.O, and their main job is to make sure the power plug is in and
switched on, then call back to the office for "PARTS". The really keen ones
will sometimes even take a cover off the equipment and pretend that they see
this stuff all the time. I wonder what sort today's is...
"You got a dud terminal?" he asks pleasantly
I tell him yeah, and bring him into the control room.
"Which one is it?" he asks, confused by the fact that only one of them is
"It's the Model Three" I say, giving NOTHING away.
"Ah, the old model three!" he says knowingly, without a clue what a model
three is, or which one of the three terminals it is, which isn't surprising,
as I just made it up.
"We get a lot of Model Three problems" he says nodding "So what actually
Sneaky, but not good enough. I'm not going to point it out to him.
"It just went dead" I say, in luser mode.
"I see. Could you just recreate what you were doing so I can check the unit
out when it's ready for operation?"
Very Sneaky. I decide to let him off the hook.
"Look, I've got to go to the toilet, there it is over there" I say, pointing
at our Waffle-Iron.
"But that's a Wa..." He says, then stops. He's a beginner, and it's just
possible that the company has a line of terminals that look like waffle
irons. He bites.
"Sorry" he says, smiling again "for a minute there I thought it was a Model
A reasonably good save, but it won't save him. "Huh, it's nothing like a
model 2! *THAT'S* the model 2" I say, pointing to the expresso machine.
He nods and I leave, which means he's got to take the iron to bits,
otherwise he knows I won't believe he's worked on it. I give him a couple of
minutes to get the element exposed then wander back in.
"So how does it look?" I ask, concerned-like.
"Well, I think we could have a processor problem.." he says concentrating on
prying the element up.
..concentrating so much that he doesn't notice me plugging the iron in.
"Shouldn't you be wearing an earthing strap?" I ask innocently.
When he thinks I can't see, he creeps his hand over to the wiring frame and
says "Well, It's just as easy to hold onto earth like this"
"But what about the risk of a cross-the-body shock with no resistor in
series with you?" I ask ever-so-more-innocently
"Oh, it's ok" he says "the unit's unplug..."
clickBZZZZZZZEEERRT!clunk! I ring the maintenance help-desk again...
"Hey Ronda!, Ah, I'm going to need another engineer and a new Waffle Iron
over here; for some reason your engineer opened up my Waffle Iron without
switching it off." I say
Rhonda knows me. It's the third call and the third appeasement engineer this
year. You'd think they'd learn.
"You're a real prick" she says, annoyed
"Tell ya what Rhonda, why don't you come and fix it; it's a Model Three..."
THE SIGNATURE FROM HELL!!!!
It's 200 pages long and got lots of ^Gs in it! And, it LOCKS UP YOUR TERMINAL!
AND you won't find out it's from <spt (a) waikato ac nz> until the 199th page. And
then it'll scroll past, you'll have to read the message again to find out that
my post addr is C/- University of Waikato, Prvt Bag 3105, Hamilton New Zealand
Here come those FORM FEEDS!!!!
Opinião dos Leitores
Seja o primeiro a comentar este artigo