Variables and GlobbingThis will show a little about how variables are used, including a simple function. We have been using bash, a program that is both a shell between us and the operating system, and a programming language. To add power to the command line, we can assign temporary variables, like this:
The equal sign assigned the characters /usr/bin to the variable b. In the next two lines we checked our assignment by echoing it. We had to use the dollar sign to indicate that it was a variable instead of the letter b. Then we did a listing of whatever was in the directory pointed to by $b. I often use the variable s to represent the source and d to represent the destination when I am copying or moving files. It saves typing. The term globbing means to use wildcards, usually with filenames. Suppose we want to find some programs that have to do with PDFs. We can use the variable we already made plus the asterisk that means "match anything" like this:
You could try using the man command to see which one is the one you want.
|
This page is This page rendered by CodeIgniter in 0.0552 seconds. |