| PLEX86 | ||
|
Printing all arguments pbutted to a bash script 2472what is going on with my usb and my HP printer Hi, I am on ubuntu dapper. I have bought HP Photosmart C4180 printer. I want to install drivers. In my system was 0.9.7 version of hplip package, but to get work this... On 2006-09-07, Angel Tsankov Printing all arguments pbutted to a bash script 2473 Well, it is not the same. To see why, test each one with an argument that contains at least one space. Here is a test script to show the difference... for var do : do something with $var done Or: do : do something with $var done man bash: Compound Commands ... for name in word ; do list ; done The list of words following in is expanded, generating a list of items. The variable name is set to each element of this list in turn, and list is executed each time. If the in word is omit- ted, the for command executes list once for each positional parameter that is set (see PARAMETERS below). The return status is the exit status of the last command that executes. If the expansion of the items following in results in an empty list, no commands are executed, and the return status is 0. ... Special Parameters The shell treats several parameters specially. These parameters may only be referenced; buttignment to them is not allowed. * Expands to the positional parameters, starting from one. When the expansion occurs within double quotes, it expands to a sin- gle word with the value of each parameter separated by the first character of the IFS special variable. That is, "$*" is equiva- lent to "$1c$2c...", where c is the first character of the value of the IFS variable. If IFS is unset, the parameters are sepa- rated by spaces. If IFS is null, the parameters are joined without intervening separators. the expansion occurs within double quotes, each parameter expand to nothing (i.e., they are removed). -- Shell Scripting Recipes: My code in this post, if any, A Problem-Solution Approach is released under the 2005, Apress GNU General Public Licence
|
||||
Printing all arguments pbutted to a bash script 2473 Linux groups from Newsgroups The #1 Usenet Provider on the Internet
|
||||