A gentleman is also a non-exclusive, good fake in things! So is bash.
Last night, the World Cup was wonderful this morning. Wake up at night to see the constantly living phone. The morning without drinking water began to admire the duel in England and Italy. Also TM wonderful, finally gave birth to the Roman culture. I would even be delighted to see the success of the Italian Ainu culture, and then look at the next game, the thunderous goal was incredible, originally intended to work overtime. A complex six-degree cutting network was studied. A bit messy, but still in the afternoon when I realized a little something. Little sleep beside, thinking how to organize bash into a tree, because I really do not want to also have the ability to use Python to create so-called advanced data structures, such as trees.
Tree. A conventional form of human organization. A data type used by humans for nearly 10,000 years. It is now assigned a unique position when mapped into computer data structures. Binary tree, heap, AVL tree, red black tree. 256 fork Tree. Radix tree. ... Almost all of the programming languages have built-in data structure types for these trees, and even if not, there are a number of avid developers who build a series of so-called libraries to implement the interfaces of these trees. But in addition to a language, the shell, for Linux it is bash (I never use other shells, despite the deep history.) But history is not reality. This is the advantage of understanding history ...), why no one developed the tree-type data structure of Linux? ... the shell is an adhesive language. is not a language to implement logic. This may be the root of it?? Let's say the World Cup commentator is playing Spain vs Holland, and has always preferred Spain to win before scoring in Holland, which is a low level of gambling, but when I said that no one was implementing the tree data structure of the bash version, someone was posted on GitHub, It was just my silly bi that I didn't find, so I stopped commenting on the principle of the battle of the long Ping. I just tried to do it, because assuming I couldn't, it would be a major dereliction of duty for my job, just as the Spanish players put the ball in their own goal ... bash why there is no simple way to implement a tree-like structure. There is not even a data structure to achieve whatever, because it does not need!
Gentlemen are good at things. Bash itself does not have the semantics of the tree, but the Unix file system is the tree organization, and Bash Operation Unix folder/file is just a duck's-in-the-blue, I suddenly think of the Linux kernel make menuconfig how to find so many config. In fact, there is no need for a unified CONGIFG. It is only necessary for each file folder to build its own config entry. Make will naturally traverse the file system and then remove the Config project. That's it, Linux, such as the Make Menuconfig command, does not need to implement a set of algorithms that traverse folders.
The
assumes that I want to implement a tree-based sequence of operations, such as TLS with SM1 and SM4 for symmetric encryption under the ECC algorithm. Use ECC or SM2 for authentication (the so-called Algorithm suite, Cipher-suit). What to do? According to the traditional programming language. I'm going to build a struct that implements a tree. However, modern complexities do not allow you to write and compile so-called structures (the key is to compile). The root of the problem is that you are trying to solve your problems in these languages (last year I.) A table, I can't get over the hurdle) or you want to study the programming language itself. If this is the latter, please skip this article, but assume it is not. I don't think C/c++/java is the right fit, Python,perl. Bash is more appropriate. Because these languages allow you to not have to think about how to build a tree, take python, for example, without saying much. I don't know much about you, but take bash for example? Because there are no libraries to use. You're stuck in the blink! ... I've been thinking about it all along, but suddenly, I don't think so, I think the library that bash can use is not without, but very much. How much to what extent? The answer is the whole system! The
Linux folder system is a tree-structured structure. Bash can use it very well! Bash has no built-in structure whatsoever. But they can take advantage of all the other structures. The designers of the Linux kernel have already thought of this. Take a look at Sysfs and Procfs. When you use commands such as Cat/echo, do you think it's easier to write your own code than you do (albeit with less opportunity to dazzle your skills ...)? Don't think of the filesystem as a dirty IPC mechanism, and you can actually work on it. You can put several grams of memory. For example, 1G all build a Ramfs. Then you have to do the file operation in it. No matter what the performance loss, remember. File IO is just an interface (please don't talk to me. System calls can affect efficiency. May be able to use mmap ... Read more books, in class silly ...)! The file interface is a very fierce thing, it can build the data structure that you cannot implement, for example tree.
I do not have to maintain a tree inside the script, I just need to create a tree file folder system can be, and then use the rich file System IO command to ravage it, assuming you do not want my extra file system to pollute your pure file system, I will build a Ramfs, I just have to format the memory.
Bash is not a programming language, but it is a full programming language that can glue all of the language into logic. It is much more than a language such as python,perl,php. It's built in Unix. Bash. It is actually the UNIX programming language itself, UNIX itself is a library!
I'm not against Modern software project, I just think that in some areas, some places, some everyday business, software project does go in the wrong direction.
The master did not know the name of his tricks when he shot. I'm thinking about people who are so well versed in design patterns. Have you ever known. You are more than the master of the design pattern field, because when these masters are making a system, they do not know what mode they are using, but you may know better. Suddenly thought of "according to the Day of the Dragon" in the Zhang Sanfeng asked Zhang Mowgli, until Zhang Mowgli's kung Fu formula all forgotten after. Only to agree to its play, the essence of it!
In the fancy football competition, the master are a bunch of hip-hop dancers, technology is too TMD, but in the World Cup except Cristiano Ronaldo almost no one dazzle fancy skills, so I thought, fancy football is not useful. Just for the show, but after watching the World Cup stars these people's fancy football performance, I know, some skills Joe only for dazzle, but the essence is not included in the so-called energy flash tip.
Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.
Bash organized into tree data structures