Whether you’ve got an interactive shell session, or are writing a shell script, it is very difficult to be certain. It’s better to check for the capabilities that you require.
If you find yourself in a shell session, but don’t know what type of shell it is, there are a few ways to find out whether it’s Bourne shell, Bash, ksh, csh, zsh, tcsh, or whatever.
However, it’s not always that simple; Bash will set $SHELL only if it was not already set, so if you were running csh and use that to call bash, then Bash’s $SHELL will still say csh, not bash. However, Bash will set the $BASH_VERSION variable, but that’s not really a guarantee that you have that version; it only tells you that there exists a variable which specifies that version. You may not even be running bash at all.
Similarly, some shells (particularly /bin/sh) are symbolic links to others – whether to bash (GNU/Linux and newer Solaris), dash (some Linux distros more recently), or ksh (AIX).
So $SHELL is a useful start, but not at all definitive. You can search for your UserID in the /etc/passwd file:
But there may be many entries containing the text “steve”, and you could be using NIS, LDAP, AD or some other authentication mechanism. $UID should be a read-only variable containing your UserID, and you can search your system-specific passwd via the getent command:
However, as my UID is 1000, this would match any line containing “1000” such as an account called “HAL1000”. So this should be one way to get your shell:
Still, you could have run another shell after picking up your default shell. You can always check $0 – that should tell you how your current shell was called. You don’t know what the $PATH variable was when that was called – if $0 says “/usr/bin/zsh” then that’s what was called (of course, it is possible that/usr/bin/zsh could have changed since your shell was invoked!). If it just says “sh” then it’s whatever “sh” was found first in the $PATH of the calling shell. And of course, you can’t find out for sure what state that shell was in at that time.
On a Linux system, “cat /proc/$$/cmdline” should also give a good clue; “ls -l /proc/$$/exe” is better (but not definitive; it may be marked “(deleted)” if it’s been deleted, so you should check if it’s been subsequently replaced by some other shell.
So – it depends why you need to know. If you need to know for sure, on an unknown system, exactly what shell you are in, then I’m sorry, it’s not possible to be absolutely certain. To be reasonably confident, check $SHELL or $0. If you need to be more certain than that, then check for the features you require.
If you’re writing a shell script which requires arrays, then define and access an array, check that the results are as expected, and if not, bail out with a message along the lines of “an array-capable shell is expected – we suggest bash or ksh”.
One of the phrases that grates on me the most is, “if you would only,” when it comes to parenting children with disorders, particularly. Attention Deficit Hyperactive Disorder is one of the most common neurobehavioral disorders in the United States, so there… Continue Reading →
Fridays are always celebration days because they mean we’re another week closer to Jelly Bean’s arrival, and today marks our victory of 33 weeks! Between starting the nursery (which mean completely rearranging my house…which meant my husband completely rearranging the house), physical… Continue Reading →
At long last, here is Chapter 1 of my book “Happily Ticked Off” for you to read if you’re interested. I hope to share more with you on this book’s progress, my writing progress and my kid’s crazy life in… Continue Reading →
Parents	Behavior, Books, Childhood, Dreams, Education, Emotions, Fear, Happily Ticked Off, Parenting, School, Stimming, Teachers, Tics, TV	
SYNOPSIS: Ethan Hunt and his team are back, taking on their most impossible mission yet, eradicating The Syndicate, an International rogue organization as highly skilled as they are, committed to destroying the IMF.
REVIEW: I love “Mission Impossible” movies because you know you’re in for a great ride. The stunts are magnificent (with Tom Cruise doing many of his own stunts, much to the chagrin, I’m sure, of the film’s insurance people), the story always has some twists and turns, and the filmmakers stay true to the original TV franchise, using the same theme music and pop culture references we all know and love. In this case, Ethan gets his assignment via an old-fashioned record player, which, of course, self-destructs.
And this installment of the franchise has everything we’ve come to expect: exotic locales (including an opera house in Vienna), complicated missions, high-speed chases, underwater shenanigans, ridiculous stunts, beautiful women, handsome men, betrayals, double crosses, and of course, Tom Cruise running!
The story begins with the IMF losing its standing after the head of the CIA (Alec Baldwin) proclaims that the covert group is outdated, too expensive, and out of control. Thus, Ethan Hunt (Tom Cruise) – who’s in the midst of searching for The Syndicate, a rogue group of former spies now working as terrorists – is left isolated from the rest of his team (Jeremy Renner, Simon Pegg and Ving Rhames).
But no worries. Hunt is resourceful and will stop at nothing to find the leader of the rogue group. Along the way, he encounters a mysterious British spy, Ilsa Faust (Rebecca Ferguson), and it’s unclear whether she’s working for The Syndicate, the good guys, or herself.
The minute you hear that familiar theme music at the beginning of “Mission Impossible: Rogue Nation” and watch Tom Cruise’s first crazy stunt – hanging off the side of a plane as it takes off – you’re drawn right back into the excellent web of the classic “Mission Impossible” franchise, which began with the 1966 TV show starring Peter Graves and Greg Morris, among others.
Spies and covert operations, it seems, never go out of style, and we can see the evolution with more modern titles like “The Americans” and “Homeland,” among hundreds of others.
Sure, some might say that “Rogue Nation” is predictable, but that’s exactly why it’s going on my “Best Movies of 2015” list. It’s thrilling, charming, undeniably entertaining, and stays true to its roots.
Sex/Nudity: Some flirting. A female character wears form-fitting clothes, including a bikini and fancy gown. Tom Cruise is shirtless in a few scenes.
Violence/Gore: Lots of action throughout the film, though not much blood is shown. Includes gunfights, explosions, hand-to-hand fighting, car and motorcycle chases and crashes, bombs exploding, sniper shootings, a drowning and resuscitation, and many dangerous stunts, including Tom Cruise hanging off the side of a plane as it takes off.
Which Kids Will Like It? Kids aged 13 and older who like fast-paced action movies or the “Mission Impossible” franchise.
The future of the Office Beer Bar & Grill, a North Jersey chain, can be seen in the transformation of its Morristown flagship from ho-hum to very happening.
In restaurant circles this fall, much attention has been focused on South Street in Morristown, where the veteran New York restaurateur Chris Cannon has been transforming the grand 1918 Vail Mansion into the multilevel Jockey Hollow Bar & Kitchen, easily the most momentous opening of the year.
Meanwhile, just three blocks up South Street, toward the Morristown Green, another transformation has taken place totally under the foodie radar.
The fooderati pay scant attention to chain restaurants, usually for good reason. Yet in its own way, the transformation of the somewhat dowdy and outdated Office Beer Bar & Grill into the Office Tavern Grill is as heartening and ambitious as the rescue of the long-vacant Vail Mansion.
What’s in a name change? In this case, a lot: a total redesign and expansion of the physical space, inside and out; a new logo and graphic design, from the sign outside to the look of the menu; and a new menu (click here to read our review). All of these significantly upgrade the dining experience, making it something the seven Office restaurants have never been: exciting.
There’s an interesting tale in how this came to be. It seems that the first Office restaurant dates to at least the early ’70s in Cranford, eons ago in restaurant time. In the mid-’80s, the Jolly Trolley in Westfield was converted into the what was likely the second Office. Later, Charlie Brown’s bought the brand; then in 2011, when it emerged from bankruptcy, sold all seven to Villa Enterprises, headquartered on South Street in Morristown. The aim from the git-go, says Kathleen Janssen, marketing manager of Villa’s 40 North restaurant group, was to upgrade and reinvent the brand.
They hired David Jackson, leader of a Rhode Island design group known for its work for hip casual chains like Au Bon Pain and stand alones like Burger Deluxe in Wayne. The project was expected to take a year, but took three, largely because the building—originally the Title Guaranty and Trust Company, older than the Vail Mansion—was structurally unsound.
A new steel skeleton solved that problem and also made it possible to create a mezzanine running the length of the building. It’s lined with extra-wide, curving booths of a type originally devised for dinner theater.
Indeed, you are watching a show, especially in the downstairs booths, which face the open kitchen and raw bar (both Office firsts). All the booths and banquettes are plushly upholstered with a cloth inspired by old New York subway-car destination rolls.
“They wanted it to be more urban and attract younger professionals,” says Jackson. “So we went with factory imagery, but not the typical exposed ductwork and metal everywhere.” Wanting to appeal to women as much as men, the designers enriched the look with dark woods, upholstered chairs and a host of original paintings of iconic office objects like staplers, pencil sharpeners and old-fashioned manual typewriters.
The paintings (by Rhode Island artists) are, in fact, one of the delights of the new space. Another is the design of the bar, with its upholstered stools and row of 40 craft-beer taps in front of a gleaming stainless-steel backsplash carved with industrial motifs.
By moving the restrooms from the front to the back, the designers were able to install French doors that invitingly open almost the whole frontage to the broad sidewalk, where tables can be placed in nice weather. Expanding the building to the rear created spaces upstairs for larger groups and a quieter environment than downstairs.
40 North aims to convert the six remaining Office Beer Bars by 2017, with site specific touches for each. Next up is Summit, which will get a train motif because it faces the commuter rail station.