cli help overloading

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
learnhow2code

cli help overloading

#1 Post by learnhow2code »

i wrote a program in python (somewhere) that would "listen" to what you typed at the cli, and provide hints. it "intercepted" whatever you typed by setting .bash_history to update on each command (there is a setting for this) and reading the file.

the python program would run with nohup, so if you typed things it recognized (including "shut up", which made it do that) it would respond accordingly.

the idea was, as you learned how to use the cli, it would give you pointers, tell you useful things you could do. id post it here, though i never loaded it with as many tips as i wanted (i think i started working on it with my wife in mind.)

anyway, here are some very simple things you can do in your .bashrc, unless youre using busybox:

Code: Select all

alias usualhelp="bash -c 'help'"
alias help="/usr/local/bin/help"
if you want the usual (not terribly useful) help command, just type usualhelp.

then if you type help, you can put a file in there that will give you a text menu of options if you dont specify a word after "help" or if you say for example "help network" it can go directly to a "page" (or even another program) to help you with network stuff.

i know puppyhelp is quite useful. a cli version could be quite useful also.

pete, i know you like the idea. what should be added?

User avatar
Pete
Posts: 660
Joined: Sun 02 Mar 2014, 18:36

Re: cli help overloading

#2 Post by Pete »

learnhow2code wrote:....
pete, i know you like the idea. what should be added?
I do like the idea.
One thing you could add is a better (clear)screen than the "normal" one
which does not really clear the whole screen but only fools you into thinking it did.

Code: Select all

alias cls='printf "\033c"'

learnhow2code

Re: cli help overloading

#3 Post by learnhow2code »

Pete wrote:
learnhow2code wrote:....
pete, i know you like the idea. what should be added?
I do like the idea.
One thing you could add is a better (clear)screen than the "normal" one
which does not really clear the whole screen but only fools you into thinking it did.

Code: Select all

alias cls='printf "\033c"'
reset isnt working on your setup? aliases are cool, there should be a whole thread for those (yeah this ones fine too) but i was thinking along the lines of stuff to put in in an overhauled "help" command. like help networking:

Code: Select all

echo -e \\nto connect to available network interfaces: \\n ; #### public domain
for p in $(ip link | cut -d " " -f 2 | tr -d ':') ; 
do if [[ "$p" != "lo" ]] ; then echo dhclient $p ; 
fi ; done ; 
echo -e \\n \\nto find available network interfaces: \\n \\nip link \| 'cut -d " " -f 2 | tr -d' \':\'
output:

to connect to available network interfaces:

dhclient eth0


to find available network interfaces:

ip link | cut -d " " -f 2 | tr -d ':'

learnhow2code

Re: cli help overloading

#4 Post by learnhow2code »

here is a start on an improved help system (for cli users)

Code: Select all

#!/usr/bin/env bash

#### license: creative commons cc0 1.0 (public domain) 
#### http://creativecommons.org/publicdomain/zero/1.0/

proginf="cli help overloading 0.1"

# to "install":
# chmod +x this file and copy it to /usr/local/bin
# add these 2 lines to .bashrc: (without the # in front)
#alias usualhelp="bash -c 'help'"
#alias help="/usr/local/bin/help"

if [[ "$1" == "" ]]  
then echo -e \\n # -e "\\036[1;36mpuppy command line help:\\033[0m\n"

function pq()
{
echo -e "$q" | tr '(' '^' | sed "s/\ \@/\x1b\[1\;37m\ \@/g" | sed "s/\@\ /\@\ \x1b\[0\;37m/g" | sed "s/\@\^/\@\x1b\[0\;37m\^/g" | tr '^' '('
}

q='         @@@@@@@@@@@@@@@@                                 ' ; pq
q='     @@@@@@@@@@@@@@@@@@@@@@@@                             ' ; pq
q='    @@@@@@@@@@@@@@@@@@@@@@@@@@                            ' ; pq
q='    @@ @@@@@@@@@@@@@@@@@@@@ @@                            ' ; pq
q='       @@@@  @@@@@@@@  @@@@                               ' ; pq
q='       @@@  ` @@@@@@  ` @@@       \x1b[1;33mpuppy command line help\x1b[0m ' ; pq
q='        @@@  @@@@@@@@  @@@@                               ' ; pq
q='        @@@@@@@@@@@@@@@@@@                                ' ; pq
q='         @@@@@@@@@@@@@@@@                                 ' ; pq
q='          @@@@@(   @@@@@                                  ' ; pq
q='           @@@(     @@@                                   ' ; pq
q='            @@@(   @@@                                    ' ; pq
q='              @@@@@@                                      ' ; pq
q='                                                          ' ; pq

echo -e "    \x1b[1;33mhelp usual   \x1b[0m  standard bash help command"
echo -e "    \x1b[1;33mhelp network \x1b[0m  help with network commands"
echo -e "    \x1b[1;33mhelp files   \x1b[0m  help with file commands"
echo -e "    \x1b[1;33mhelp config  \x1b[0m  help with some puppy settings"
echo -e "    \x1b[1;33mhelp misc    \x1b[0m  commands to reboot, stop beeping, etc."
echo -e "    \x1b[1;33mhelp coding  \x1b[0m  quick help for coding"
echo -e "    \x1b[1;33mhelp alias   \x1b[0m  aliases to customize bash"
echo

else

if [[ "$1" == "usual" ]]  
then bash -c 'help' 
fi

if [[ "$1" == "network" ]]  
then echo -e "help with network commands" \\n

echo -e \\nto connect to available network interfaces: '(use one)'\\n
for p in $(ip link | cut -d " " -f 2 | tr -d ':') ;
do if [[ "$p" != "lo" ]] ; then echo dhclient $p ;
fi ; done ;
echo -e \\n \\nto find available network interfaces: \\n \\nip link \| 'cut -d " " -f 2 | tr -d' \':\'

fi

if [[ "$1" == "files" ]]  
then echo "help with file commands" 
fi

if [[ "$1" == "config" ]]  
then echo "help with some puppy settings" 
fi

if [[ "$1" == "misc" ]]  
then echo "commands to reboot, stop beeping, etc." 
fi

if [[ "$1" == "coding" ]]  
then echo "quick help for coding" 
fi

if [[ "$1" == "alias" ]]  
then echo "aliases to customize bash" 
fi

fi

ebisu
Posts: 176
Joined: Wed 25 Sep 2013, 05:06

#5 Post by ebisu »

help case :wink:

learnhow2code

#6 Post by learnhow2code »

ebisu wrote:help case :wink:
edit: you meant a totally different thing than i thought you meant. :)
Last edited by learnhow2code on Tue 21 Jun 2016, 11:32, edited 1 time in total.

User avatar
Pete
Posts: 660
Joined: Sun 02 Mar 2014, 18:36

#7 Post by Pete »

@learnhow2code

A few suggestions if I may, make the script available as an attachment
to make it easier for those that are starting to learn the CLI.
Include lots of help on how to run, change permissions and so on
and give it a version number.

Perhaps even start a new thread especially for it, similar to what I have done with fields.awk.

You don't necessarily have to limit it to just the help system but make it more
general with handy hints and tips for the CLI newcomers.

Lastly, I highly recommend LXTerminal (available in the PPM) over urxvt due to
it's superior handling of copy and paste.
Will certainly make a newcomers life on the CLI much easier being able to
copy/paste to/from the GUI.

ebisu
Posts: 176
Joined: Wed 25 Sep 2013, 05:06

#8 Post by ebisu »

learnhow2code wrote:

Code: Select all

     (.)  (.)


  ()))))))))))))
       ()     ()
       ()     ()
         ())))

Code: Select all

case $1 in
  files)  echo "help with file commands" ;;
  config) echo "help with some puppy settings"  ;;
  misc)   echo "commands to reboot, stop beeping, etc." ;;
  coding) echo "quick help for coding"  ;;
  alias)  echo "aliases to customize bash"  ;; 
esac

learnhow2code

#9 Post by learnhow2code »

[quote="ebisu"]

Code: Select all

case $1 in
  files)  echo "help with file commands" ;;
  config) echo "help with some puppy settings"  ;;
  misc)   echo "commands to reboot, stop beeping, etc." ;;
  coding) echo "quick help for coding"  ;;
  alias)  echo "aliases to customize bash"  ;; 
esac
i can see how this could be useful; i used the case structure in basic for years.

after over half a decade using python, case and i havent really stayed in touch. thanks for the fond feelings of an old friend.

that said, i would never use it in bash unless i had to-- the double semicolons are just about the most hideous syntax ive ever seriously considered using, and the rest of it simply makes it more difficult to find the conditional structure when the script gets large enough.

$1 is never going to be files and misc at the same time, and the rest of it is premature-optimizationy, but i will look out for a point where a "switch" (a ha) is needed.

learnhow2code

#10 Post by learnhow2code »

Pete wrote:A few suggestions if I may, make the script available as an attachment
to make it easier for those that are starting to learn the CLI.
good idea, but i was hoping people would look at it, offer ideas like you did, and (while its small) thats more likely to happen if you can just look at the code-- why download it (and install) if you dont know what its for? its not ready for that imo.

also the simpler it stays, the easier for a new scripter to learn how it works (thats one reason why i dont want case if i can help it. if then fi is more universal, and semantically closer to while and for loops. case, even in basic, may be better but its great to learn it as an alternative to if. the logo doesnt fit this theme, obviously.)


i confess that while i will consider any changes proposed, what im really looking for is suggestions for info i can add to help the user. thats the part i wish i could get input from *everyone* on.
Include lots of help on how to run, change permissions and so on
and give it a version number.
it may come to that. i was hoping to entice devs to consider making it a standard feature. in which case not only can they figure it out, but i gave instructions:
# to "install":
# chmod +x this file and copy it to /usr/local/bin
# add these 2 lines to .bashrc: (without the # in front)
#alias usualhelp="bash -c 'help'"
#alias help="/usr/local/bin/help"
they dont have to use the puppy part. i thought it was fun, its not the most important part of the script.

it has a version number. its even set in a variable near the top. what do you propose?

Perhaps even start a new thread especially for it, similar to what I have done with fields.awk.
yeah, i might. there was only one post prior, so if i post without that, im removing the part that says "what should we do with this?" and context is good.

You don't necessarily have to limit it to just the help system but make it more
general with handy hints and tips for the CLI newcomers.
im not sure how much to expand it, especially without a number of suggestions. im framing any of whatever gets added as "help system." doesnt have to be a single script. could be used to call interactive tutorials.
I highly recommend LXTerminal (available in the PPM) over urxvt due to
it's superior handling of copy and paste.
Will certainly make a newcomers life on the CLI much easier being able to
copy/paste to/from the GUI.
same here. i even prefer it to the one in xfce. however, as long as the default is standard by comparison, helping people with what they have is a priority:

"why would i install a second term if i dont even use this one?"

"because youll like it more."

"thats ok, i probably wont use the term anyway. i dont need another one."

maybe puppy uses urxvt because its light, or no one cares, or because it has those awesome features they mentioned. like you, i really like the lx one. i often install it even when i dont use lxde.

User avatar
Pete
Posts: 660
Joined: Sun 02 Mar 2014, 18:36

#11 Post by Pete »

I for one think that your help project is a good one but try and make the installation procedure all based on the GUI.
Include screenshots or even make available the procedure in html files.
This will help more people ease into the CLI.

To those that know the CLI already, things like chmod, mv and so on are not a big deal, but for those that don't?

learnhow2code

#12 Post by learnhow2code »

Pete wrote:I for one think that your help project is a good one but try and make the installation procedure all based on the GUI.
Include screenshots or even make available the procedure in html files.
This will help more people ease into the CLI.
the point is to have the user only need to type "help."

its a single bash script-- the user shouldnt have to install (or copy, or download) anything at all.

if it has good information (thats still the main thing its missing, otherwise its like a website but no content on it) then it would be reasonable for someone to overload the help command with it, in their puplet.

other than that use case, im happy to support people that want to install it, but i would not suggest making a package out of it.

making it a package would ensure that its useless and a waste of time. it should come pre-installed, thats what its for.

also pointless if no one suggests commands to include. yes, i can do all that myself, though i thought it would be far more reasonable to allow input first. who am i to rewrite "help" without input?

it should not be a package. its pointless as a package. and making it easier to install for people that cant use it they way it is right now? also pointless. the only people that should be installing it right now, are people who already get the idea of the standard help command. they will be able to run it quite easily.

anyone else would simply be wasting their time. this is a programming subforum, about code and writing code. i do know where the subforum for packages is.

ebisu
Posts: 176
Joined: Wed 25 Sep 2013, 05:06

#13 Post by ebisu »

learnhow2code wrote:that said, i would never use it in bash unless i had to-- the double semicolons are just about the most hideous syntax ive ever seriously considered using,
If you never use or seriously consider a more efficient option because you have problems with double semicolons then you are not a serious coder :lol:

learnhow2code

#14 Post by learnhow2code »

ebisu wrote:If you never use or seriously consider a more efficient option because you have problems with double semicolons then you are not a serious coder :lol:
thats not true at all-- i am serious enough that when you overload or double an already-redundant syntax element,, thats when i actually take offense. also, you claim that i didnt seriously consider it. ive thought about it more than once today;; its still appalling.

seriously though, the semicolon is overrated;; the one thing i do like about it is that it shows clearly the demarcation between logical loc,, without being tedious to type on us keyboards. (if youre in europe you may not enjoy semicolons as much as i do.)

i like the idea of code not confusing people without any real need;; theres no real purpose for a "double semicolon" syntactic element. whoever came up with that was smoking something-- even if it was charles babbage. who loves semicolons so much,, they want twice as many as they already have,, and four times as many as they even need? :P you may think i reject it on aesthetics-- no, i think "redundancy, ambiguity, tediousness: at least try to maintain a limit of two!" :) cheers.

honestly, its my fault for not being more explicit that was looking for tips for things to include as content. i dont mind the back-and-forth about minutiae, thats fun too. but as-is, the script does nothing anyway. too bad, it had potential. no intention of making it perfect at what it does until its useful-- theres nothing efficient about that... and a "serious coder" wouldve used c for this anyway!

ebisu
Posts: 176
Joined: Wed 25 Sep 2013, 05:06

#15 Post by ebisu »

learnhow2code wrote:thats not true at all-- i am serious enough that when you overload or double an already-redundant syntax element,, thats when i actually take offense. also, you claim that i didnt seriously consider it. ive thought about it more than once today;; its still appalling.

seriously though, the semicolon is overrated;;
:lol: If you feel so emotional about seemingly overloaded and redundant syntax elements then count the redundant semicolons in your code

Code: Select all

for p in $(ip link | cut -d " " -f 2 | tr -d ':') ; 
do if [[ "$p" != "lo" ]] ; then echo dhclient $p ; 
fi ; done ;
I also wonder why you use double brackets and double equations. Don't you find those "appalling"? In your script they are not even needed.

learnhow2code

#16 Post by learnhow2code »

ebisu wrote:I also wonder why you use double brackets and double equations. Don't you find those "appalling"? In your script they are not even needed.
great question. the reason is that when i go to single brackets and equals, it doesnt work as reliably.

i always do double brackets, and it works more of the time. i dont stop to think about single or double, because double works. i dont like that its double, but it works. but were you aware that single brackets arent even part of the syntax? so thats another reason not to use them.

if id designed bash, it wouldnt require double brackets. or double equals. but bash was cobbled together from various shells, and is like it is. thats why i like python better. you know, i like bash, but it wasnt my first choice for this script. i wouldve preferred fig for that. fig only has 1 double syntax element, the "double" quote (its a single character) and there are several justifications.

Code: Select all

#### license: creative commons cc0 1.0 (public domain) 
#### http://creativecommons.org/publicdomain/zero/1.0/

proginf="cli help overloading 0.1f (fig version)"

# to "install":
# chmod +x this file and copy it to /usr/local/bin
# add these 2 lines to .bashrc: (without the # in front)
#alias usualhelp="bash -c 'help'"
#alias help="/usr/local/bin/help"

now "" print

function command
r 
python
    r = figargv[1:]
fig
now return r
resume

c = command join c " " lcase

ifequal c ""

q colortext 15 "         @@@@@@@@@@@@@@@@                                 "  print
             q="     @@@@@@@@@@@@@@@@@@@@@@@@                             "  print
             q="    @@@@@@@@@@@@@@@@@@@@@@@@@@                            "  print
             q="    @@ @@@@@@@@@@@@@@@@@@@@ @@                            "  print
             q="       @@@@  @@@@@@@@  @@@@                               "  print
             q="       @@@" prints colortext 7 "  ` " prints colortext 15 "@@@@@@" prints colortext 7 "  ` " prints
             q colortext 15 "@@@       " prints colortext 11 "puppy command line help" print colortext 15
             q="        @@@  @@@@@@@@  @@@@                               " print
             q="        @@@@@@@@@@@@@@@@@@                                " print
             q="         @@@@@@@@@@@@@@@@                                 " print
             q="          @@@@@" prints colortext 7 "(" prints colortext 15 "   @@@@@                                  " print
             q="           @@@" prints colortext 7 "(" prints colortext 15"     @@@                                   " print
             q="            @@@" prints colortext 7 "(" prints colortext 15 "   @@@                                    " print
             q="              @@@@@@                                      " print
             q="                                                          " print colortext 7

e colortext 14 "    help usual   " prints colortext 15 "  standard bash help command" print
e colortext 14 "    help network " prints colortext 15 "  help with network commands" print
e colortext 14 "    help files   " prints colortext 15 "  help with file commands" print
e colortext 14 "    help config  " prints colortext 15 "  help with some puppy settings" print
e colortext 14 "    help misc    " prints colortext 15 "  commands to reboot, stop beeping, etc." print
e colortext 14 "    help coding  " prints colortext 15 "  quick help for coding" print
e colortext 14 "    help alias   " prints colortext 15 "  aliases to customize bash" print
e colortext 7 "" print

fig

ifequal c "usual"  
then "bash -c 'help'" shell 
fig

ifequal c "network"   
t "help with network commands" print
q 34 chr
t "\nto connect to available network interfaces: (use one)\n" print
t "bash -c 'for p in $(ip link | cut -d " plus q plus " " plus q plus " -f 2 | tr -d ':') ; do if [[ " plus q plus "$p" plus q plus " != " plus q plus "lo" plus q plus " ]] ; then echo dhclient $p ; fi ; done'" shell

t "\n \nto find available network interfaces: \n \nip link | 'cut -d " plus q plus " " plus q plus " -f 2 | tr -d ':'" print

fig

ifequal c "files"  
t "help with file commands" print
fig

ifequal c "config"   
t "help with some puppy settings" print
fig

ifequal c "misc"  
t "commands to reboot, stop beeping, etc." print
fig

ifequal c "coding"   
t "quick help for coding" print
fig

ifequal c "alias"   
t "aliases to customize bash" print
fig

ebisu
Posts: 176
Joined: Wed 25 Sep 2013, 05:06

#17 Post by ebisu »

learnhow2code wrote:were you aware that single brackets arent even part of the syntax? so thats another reason not to use them.
I don't understand what you mean. A single '[' is a builtin command like any other command like 'exec' or 'exit'. It works 100% reliable if you know how to use it. What reason do you see to avoid a POSIX compliant command?

learnhow2code

#18 Post by learnhow2code »

ebisu wrote:
learnhow2code wrote:were you aware that single brackets arent even part of the syntax? so thats another reason not to use them.
I don't understand what you mean.
a single bracket is an alias, it is not part of the interpreter. yes, you may insist (and i will even partly agree) that aliases, scripts and binaries "become" part of the language environment, as does a python library written in c.

but if you wrote down the scripting language interpreted by bash, single brackets are an alias. ls /usr/bin if you dont believe me.
A single '[' is a builtin command like any other command like 'exec' or 'exit'.
then perhaps it is overridden by this:

Code: Select all

 $ ls /usr/bin -l | grep '\['
-rwxr-xr-x 1 root root      38536 Mar 14  2015 [
now will you knock off the ad-hom? i dont need to be whatever kind of "serious coder" you think i need to be to justify how i code to myself. im happy to debate without you trying to one-up me over absolute minutiae.

i dont think im better than you. i dont know if youre better than me (its very possible youre a more disciplined coder; many are, since i do a lot of it for fun. but thats three decades of thinking, experimenting and fun, thank you very much.)
It works 100% reliable if you know how to use it.
it can fail on comparing zero-length strings in double quotes, which happens to be exactly what im comparing a lot of the time: "$x"

i find that even more irritating than using what amounts to wiki syntax. though if i had my way, [ and [[ would do exactly the same thing.

they dont. i use the one that works for what im doing, why on earth would that be "wrong?" (simple answer, it isnt.)

perhaps you misunderstand my intentions: im not telling you that YOU shouldnt use double semicolons. use them all you like.

i have no desire for them. and you still havent made a case for why i need them in my life, youve simply used semicolons to say why im not high enough in your regard. and then you do it again with single brackets: --a syntax element that isnt even in the interpreter.--

now, all i want out of that point is to get you to think hmm... maybe i have a point here. thats all. but if you still cant consider that as a possibility, i think you just dont want to be right.

and i could still be wrong.
What reason do you see to avoid a POSIX compliant command?
if you mean the double semicolon, i answered that. it isnt the aesthetics of it (although i dont care for those either) but the combination of "redundancy, ambiguity, [and] tediousness" in the thing.

if you mean the single bracket, i explained that too: it doesnt work as i think it ought to, but the other one does.

if you think gnu/linux ought to try to maintain posix compliance, it probably has a way to go. i hope youre still singing that tune when poettering comes to town. but if youre telling me that i should use a single bracket over a double because of posix, i will tell you to paddle upstream and bother the bash developers about it.

im coding in bash, not unix. within reason, i will try for both just because i dont think posix is useless-- but individuals dont need to be chased around and beaten with it either. i will never comply with unix design as much as the bsds do (if only because theyre better at it,) and not one of them is fully posix compliant, either.

i did have some fun today, thanks to you. i created /usr/bin/exit to see if it would override the built-in. (it doesnt. nor should it... the built-ins come before stuff in the path. you can call /usr/bin/exit explicitly when you include the path in the call.)

also this: (because i was actually curious)

Code: Select all

for z in $(busybox --help | grep Currently -A 100 | grep -v Currently | sed "s/\,//g") ; do c="$(which $z | wc -l)" ; echo $c $z ; done | sort -n # public domain
cheers.

ebisu
Posts: 176
Joined: Wed 25 Sep 2013, 05:06

#19 Post by ebisu »

learnhow2code wrote:i did have some fun today, thanks to you. i created /usr/bin/exit to see if it would override the built-in. (it doesnt. nor should it... the built-ins come before stuff in the path. you can call /usr/bin/exit explicitly when you include the path in the call.)
What is your conclusion from your test? Why should /usr/bin/[ behave differently? Why do you speculate that the builtin single [ is "perhaps" be overridden by /usr/bin/[ ? And why would a double [[ not be overwridden by /usr/bin/[[ ?

For more fun try some "cli help overloading" in your console:
help [
help [[
/usr/bin/[ --help
/usr/bin/[[ --help

learnhow2code

#20 Post by learnhow2code »

ebisu wrote:
learnhow2code wrote:What is your conclusion from your test? Why should /usr/bin/[ behave differently? Why do you speculate that the builtin single [ is "perhaps" be overridden by /usr/bin/[ ?
i wasnt entirely serious about the built-in being overridden, that was tongue-in-cheek (i considered it as a possibility, but a VERY unlikely one.) after writing that, i tried overriding built-in exit (per your comparison) and found-- not surprisingly-- that /usr/bin wont override built-ins without a path included in the call: /usr/bin/exit or cd /usr/bin ; ./exit

so clearly, [ is not builtin. and there is no /usr/bin/[[ (there is in puppy, i will get to why) because unlike [, [[ IS a builtin. which is what i was saying.

now, puppy uses busybox, and [ is still an alias... to busybox. in puppy, so is [[

but on a real bash setup, there is no /usr/bin/[[ (alias or otherwise) it is built-in. as long as we are talking about bash, the interpreter/binary/language, [[ is built-in and [ is a binary. (in puppy, its an alias to a binary. but so is ls and a lot of other things.)

if i do which [ i get /usr/bin/[ but if i do which [[ i get a newline. (actually the newline is from hitting enter.)
And why would a double [[ not be overwridden by /usr/bin/[[ ?
it would, if you called it with a path (full or relative.) but not without at least that.
For more fun try some "cli help overloading" in your console:
help [
help [[
neither of these do anything. they might if i load puppy, ive been trying a lot of things in puppy the past few days-- thats how i know [ is an alias to busybox in puppy. in a full bash setup, it is its own binary.

if youre suggestion i add [ and [[ as options for the help command, i wouldnt know what to say about them. we dont even agree what they do.
/usr/bin/[ --help
that works.
/usr/bin/[[ --help
that doesnt work, but it most likely will in puppy, but only because of the busybox setup.

the things that ive said are true of bash, but in busybox (which i consider a very useful and worthwhile piece of software, but it is quite different in the way binaries are setup-- not like a standard bash system or standard gnu utils either) some of the things youre saying become partly true.

before we quibble further over details, that has to be pointed out. i stand by what i said however, as what i said is both true and accurate. and i still dont agree with you about [ vs. [[... because im probably right, and we dont agree.

you are however, nearly right-- but about busybox, not standard bash. if we cant agree that bash is bash and busybox is sort of like bash, then im still happy to say we arent talking about exactly the same thing.

[[ is a built-in, which is what ive been saying all this time. and [ is never a built-in. in busybox it is still a binary, but in busybox the binaries are called through aliases to busybox.

that doesnt change my position (no reason why it should) but it does muddy the water and make it more interesting to try to get on the same page about any of this.

im curious about these things:

* do you think [ and [[ are the same:
* ...in puppy/busybox?
* ...in bash?
* if they are the same, you must prefer [ as its easier to type (if they were the same, i would prefer it too. its easier to type.)
* if they are not the same, why do you prefer [ over [[ (other than one is easier to type.)

dont answer those unless it pleases you. as i said, im wondering about them.

Post Reply