Rockbox Development > Starting Development and Compiling
ipodpatcher scripting question.
jackbnymbl:
I'm writing a script which requires the use of ipodpatcher, and I'm kindof a scripting n00b, so I was wondering if anyone could tell me how to get just the device location from "ipodpatcher --scan", e.g. "/dev/sda" and input it to a variable?
It would also be nice if it could output the iPod type to a variable, e.g. "1st generation iPod Nano"
bluebrother:
redirect the output of ipodpatcher and cut everything you don't need -- perl will do, as various other ways like using sed / awk.
jackbnymbl:
I looked at the man pages for sed and awk, but I'm still blank (like I said, I'm kindof a n00b here). Maybe someone can give me some scripting help?
bluebrother:
try something like this:
./ipodpatcher -l 2>/dev/null | sed -e '/Ipod\ model/!d;s/^.*\:\ //'
./ipodpatcher -l 2>/dev/null | sed -e '/Ipod\ found/!d;s/^.*\///'
jackbnymbl:
Thanks for the help, but now I just can't figure out how to get the output into a variable. Also, is there any chance to make the first command not display "winpod"/"macpod" and the second one include /dev/? Thanks for your help though.
Navigation
[0] Message Index
[#] Next page
Go to full version