vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Henk Oegema wrote: > Henk Oegema wrote: > >> Henk Oegema wrote: >> >> The problem is solved. >> >> When I do a >> asterisk:/home/henkoegema# k8055 -m:1 >> is shows: >> Velleman Device Found @ Address 018 Vendor 0x010cf Product ID 0x05500 >> get driver name: could not get bound driver: No data available >> Found interface 0 >> Took over the device >> 225;0;119;132;2;1 >> >> When I do >> asterisk:/home/henkoegema# k8055 -m:1 > test >> >> it only shows >> 225;0;119;132;2;1 >> in the file. > > The only disadvantage is that I have to create a file first. > Can't the value 0 (in the line 225;0;119;132;2;1) be assigned directly to a > bash variable ? (without reading it from a file) I hope I'm understanding your question correctly. I assume that k8055 is a script or binary you're running, -m:1 being an argument to the command, it's outputting information to stdout, and from that outputted information, you're only interested in a line that contains ;0;, and you're currently redirecting stdout to a file named "test". Why not pipe it to grep? k8055 -m:1 | grep \;0\; So long that ;0; is unique from the dump to stdout, it should be the only hit that grep finds. - Ken |