Blackjack Betting Systems
If you've been a faithful reader of this column since the beginning, you'll know that almost two years ago we started out by writing a Blackjack game as a shell script. It was a long-winded affair (I didn't just say that, did I ), but as part of the project, we created a simple way to emulate a deck of cards, shuffle the cards (that is, put them in quasi-random order) and even convert a numeric 1-52 value into a suit and rank.
You may recall from the section The find Command on page 219 that sometimes an error message would be displayed when access to a particular folder was not allowed, such as with the following command, in which some of the folders are not permitted to be searched by regular users find -name blackjack
Find -name blackjack more The way we force a particular stream to be used is to place it directly before a redirection or pipe operator. So, for example, we could send all the stderr error messages from a command directly to a different file like this find -name blackjack 2 ignoreme.txt However, this is not an optimal solution, because we end up creating a useless file that's not actually wanted or needed. But as I mentioned in the section Using Redirection on page 237, this scenario has already been covered by the operating system's programmers, who created an imaginary device called dev null, which acts as a black hole for unwanted output. Therefore, a much more elegant solution would be to redirect all the output from stderr into that abyss, like this find -name blackjack 2 dev null If you try out this improved version, you'll have to wait before you see anything while all the various folders are searched. But sure as eggs are eggs, your patience will be rewarded, as one by one,...
The program supports many options, but at its most basic you use it by entering a command such as this find -name blackjack This command searches the entire filesystem for any files called blackjack. However, as you will see from Figure 7-4, folders that you do not have permission to access are skipped, with the error message Permission denied. At the top of the screen grab, you'll see that six files with the name blackjack have been found, and plenty of folders have not been searched due to permission settings. If you want to be given access to these folders, you can use the sudo command to temporarily become the root user (see the section Using sudo on page 252 for more information), like this (entering your password when prompted) sudo find -name blackjack Either way, from the information returned, we can see that the likely location of the blackjack program is usr games blackjack, shown in the fourth line in the screenshot. Of course, the default Ubuntu games are all available...
Ultimate Blackjack System
Discover the 100 Legal Secrets Las Vegas Professional Blackjack Gamblers Use to Make Literally Thousands of Dollars Every Week... I'll Teach You the Ultimate Step-by-Step Blackjack System, Casino's Don't Want You to Know About! That's Right, I'll show you step-by-step how to have the blackjack odds in your favor, guaranteed!