Prev | Current Page 360 | Next

Michael McCallister

"openSUSE Linux Unleashed"

Also notice that when using the
square brackets, you don??™t need to worry about the multiplication symbol. The shell
knows that it is not a wildcard character because it is within the square brackets.
NOTE
Unfortunately, the bash shell does not have the ability to perform floating point arithmetic,
only integer arithmetic. If you must do floating point arithmetic, there are few tricks
that programmers have used, such as redirecting the numbers and operators as strings
to the bc program, which is a calculator provided by the bash shell. You can also try
using the Z shell (zsh) included in openSUSE. It handles floating point values just fine.
Advanced Shell Programming
Now that you have the basics of shell programming down, it??™s time to dig deeper into
some other commands and techniques available. The commands and techniques
presented in this section will help make your shell scripts more like real programs.
User Input
Often shell scripts must interact with whoever is running them. There are two ways for a
script to retrieve data from a user:
.


Pages:
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372
news news Dopra.pl news news