test for ksh/bash

isKsh () { one=1; [ one -eq 1 ] 2> /dev/null; }
Dave Korn gave me this one. It works because ksh allows variable names ( w/o the $name syntax ) used by sh and bash. I wrote it to permit "single source" shell libraries; the current objective: every shell library may be sourced by either shell. see http://github.com/applemcg/backash
Sample Output
.$ PS1='$ '
$ sh_PS1
B.bin.$ cat .i
function sh_PS1 
{
    isKsh && {
        PS1="K.\$(basename \$PWD).$ "
    } || {
        PS1="B.\W.$ "
    }
}
B.bin.$ 

2
By: applemcg
2014-11-18 20:45:12

What Others Think

You essentially need to guarantee that you will fun toys. Fortunately, there are a huge amount of open fun toys like stuffed toys. You can visit https://www.checkpunctuation.com/free-punctuation-checker-tool/ to read more info. In any case, they're less instructive appeared differently in relation to well known learning toys like structure squares and the inclinations.
anonymous11 · 51 weeks and 4 days ago
This is the most simplified code I have ever used for testing ksh/bash. Once should visit http://www.verbchecker.com/try-our-professional-verb-tense-checker/ for more details. I have saved this command so that I could use it whenever I want.
Sienna01 · 51 weeks ago
Different games practices must be converged into normal consistently presence to stay sound. Looking into such sort of activities is fundamental for the mental and actual improvement of a child. You can click http://www.apostrophechecker.com/how-to-use-apostrophes-in-names/">http://www.apostrophechecker.com/how-to-use-apostrophes-in-names/ for more ideas. One can see basic changes in himself pondering these activities.
Ahmed74 · 43 weeks and 1 day ago
Different games practices must be converged into normal consistently presence to stay sound. Looking into such sort of activities is fundamental for the mental and actual improvement of a child. You can click http://www.apostrophechecker.com/how-to-use-apostrophes-in-names/ for more ideas. One can see basic changes in himself pondering these activities.
Ahmed74 · 43 weeks and 1 day ago
You have starting late showed me a strategy for interceding in any case, at whatever point I have for all intents and purposes no an ideal event to do it. Visit using semicolons and colons for more ideas. It has empowered me to consider at whatever point I need.
Ahmed74 · 43 weeks and 1 day ago
This is a great practice for me to master kshbash. Thank you for the codes. https://serendipitymommy.com/concrete-or-fiberglass-pool-deck/
SeanCosta · 22 weeks and 6 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: