I can fix this command, I want the output:
ifconfig eth0 | GRP HWAD | However, when I set up a variable command, and print the variable, I get an error: CASS_INTERNAL = 'Ifconfig eth0 | GRP HWAD | Awk '{print \ $ 5}' `$ CASS_INTERNAL
My internal xxx ip: command not found
Strange thing - my Internal IP really shows how can I go about this without any errors? It should not make any difference, but I am using the latest version of Ubuntu.
Well, you're the first to grep hwdder, so this field on the fifth field of the network adapter's MAC address - Your local IP address is not.
Others have suggested that the solution is to resonate the result, that is, if eth0 in this example is not available at the time that line is executed, it will not work
< P> You can understand what you want by putting the desired command line into the variable, then evaluate it later. This pattern is commonly called lazy evaluation , and it is done using the eval builtin: desired in #put variable Order CASS_INTERNAL = 'Ifconfig eth0 | GRP HWAD | Awk "{print \ $ 5}" '# ... then evaluate its content later! Aval $ CASS_INTERNAL 11: 22: 33: AA: BB: CC
Comments
Post a Comment