From: Ryan P. <ry...@pe...> - 2007-09-28 18:39:07
|
Hi all, Quick one for you guys... I need to pull the serial number of the CPU of the gumstix from /proc/cpuinfo. It's the very last line in the output: Processor : XScale-PXA255 rev 6 (v5l) BogoMIPS : 397.31 Features : swp half fastmult edsp CPU implementer : 0x69 CPU architecture: 5TE CPU variant : 0x0 CPU part : 0x2d0 CPU revision : 6 Cache type : undefined 5 Cache clean : undefined 5 Cache lockdown : undefined 5 Cache format : Harvard I size : 32768 I assoc : 32 I line length : 32 I sets : 32 D size : 32768 D assoc : 32 D line length : 32 D sets : 32 Hardware : The Gumstix Platform Revision : 0000 Serial : 328e1362e7af4134 I just need the serial number, not the preceding text or spaces. Any ideas how this might be done? The closest I can get is to type "cat /proc/cpuinfo | grep Serial" Thanks! Ryan |
From: Chris D. <chr...@gm...> - 2007-09-28 18:45:49
|
cat /proc/cpuinfo | tail -n 1 On 9/28/07, Ryan Pederson <ry...@pe...> wrote: > Hi all, > > Quick one for you guys... > > I need to pull the serial number of the CPU of the gumstix from > /proc/cpuinfo. > > It's the very last line in the output: > > Processor : XScale-PXA255 rev 6 (v5l) > BogoMIPS : 397.31 > Features : swp half fastmult edsp > CPU implementer : 0x69 > CPU architecture: 5TE > CPU variant : 0x0 > CPU part : 0x2d0 > CPU revision : 6 > Cache type : undefined 5 > Cache clean : undefined 5 > Cache lockdown : undefined 5 > Cache format : Harvard > I size : 32768 > I assoc : 32 > I line length : 32 > I sets : 32 > D size : 32768 > D assoc : 32 > D line length : 32 > D sets : 32 > > Hardware : The Gumstix Platform > Revision : 0000 > Serial : 328e1362e7af4134 > > I just need the serial number, not the preceding text or spaces. Any ideas > how this might be done? > > The closest I can get is to type "cat /proc/cpuinfo | grep Serial" > > Thanks! > > Ryan > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > > |
From: Ryan P. <ry...@pe...> - 2007-09-28 18:48:52
|
Thanks Chris, The reason I need this is to set the hostname to the serial number of the processor. Just to keep all of them unique... cat /proc/cpuinfo | tail -n 1 and cat /proc/cpuinfo | grep Serial both give me: Serial : 328e1362e7af4134 I need it to output 328e1362e7af4134 for the hostname. I'll then echo 328e1362e7af4134 > /etc/hostname && hostname /etc/hostname, or whatever. Thanks, Ryan On 9/28/07, Chris Dollar <chr...@gm...> wrote: > > cat /proc/cpuinfo | tail -n 1 > > On 9/28/07, Ryan Pederson <ry...@pe...> wrote: > > Hi all, > > > > Quick one for you guys... > > > > I need to pull the serial number of the CPU of the gumstix from > > /proc/cpuinfo. > > > > It's the very last line in the output: > > > > Processor : XScale-PXA255 rev 6 (v5l) > > BogoMIPS : 397.31 > > Features : swp half fastmult edsp > > CPU implementer : 0x69 > > CPU architecture: 5TE > > CPU variant : 0x0 > > CPU part : 0x2d0 > > CPU revision : 6 > > Cache type : undefined 5 > > Cache clean : undefined 5 > > Cache lockdown : undefined 5 > > Cache format : Harvard > > I size : 32768 > > I assoc : 32 > > I line length : 32 > > I sets : 32 > > D size : 32768 > > D assoc : 32 > > D line length : 32 > > D sets : 32 > > > > Hardware : The Gumstix Platform > > Revision : 0000 > > Serial : 328e1362e7af4134 > > > > I just need the serial number, not the preceding text or spaces. Any > ideas > > how this might be done? > > > > The closest I can get is to type "cat /proc/cpuinfo | grep Serial" > > > > Thanks! > > > > Ryan > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2005. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > gumstix-users mailing list > > gum...@li... > > https://lists.sourceforge.net/lists/listinfo/gumstix-users > > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > |
From: Duane B. <dua...@gm...> - 2007-09-28 18:54:23
|
cat /proc/cpuinfo | grep Serial | cut -d: -f2 | sed 's/^[ \t]*//;s/[ \t]*$//' On 9/28/07, Ryan Pederson <ry...@pe...> wrote: > Hi all, > > Quick one for you guys... > > I need to pull the serial number of the CPU of the gumstix from > /proc/cpuinfo. > > It's the very last line in the output: > > Processor : XScale-PXA255 rev 6 (v5l) > BogoMIPS : 397.31 > Features : swp half fastmult edsp > CPU implementer : 0x69 > CPU architecture: 5TE > CPU variant : 0x0 > CPU part : 0x2d0 > CPU revision : 6 > Cache type : undefined 5 > Cache clean : undefined 5 > Cache lockdown : undefined 5 > Cache format : Harvard > I size : 32768 > I assoc : 32 > I line length : 32 > I sets : 32 > D size : 32768 > D assoc : 32 > D line length : 32 > D sets : 32 > > Hardware : The Gumstix Platform > Revision : 0000 > Serial : 328e1362e7af4134 > > I just need the serial number, not the preceding text or spaces. Any ideas > how this might be done? > > The closest I can get is to type "cat /proc/cpuinfo | grep Serial" > > Thanks! > > Ryan > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > > |
From: Ryan P. <ry...@pe...> - 2007-09-28 18:59:27
|
Excellent! Thank you very much! Ryan On 9/28/07, Duane Beck <dua...@gm...> wrote: > > cat /proc/cpuinfo | grep Serial | cut -d: -f2 | sed 's/^[ \t]*//;s/[ > \t]*$//' > > On 9/28/07, Ryan Pederson <ry...@pe...> wrote: > > Hi all, > > > > Quick one for you guys... > > > > I need to pull the serial number of the CPU of the gumstix from > > /proc/cpuinfo. > > > > It's the very last line in the output: > > > > Processor : XScale-PXA255 rev 6 (v5l) > > BogoMIPS : 397.31 > > Features : swp half fastmult edsp > > CPU implementer : 0x69 > > CPU architecture: 5TE > > CPU variant : 0x0 > > CPU part : 0x2d0 > > CPU revision : 6 > > Cache type : undefined 5 > > Cache clean : undefined 5 > > Cache lockdown : undefined 5 > > Cache format : Harvard > > I size : 32768 > > I assoc : 32 > > I line length : 32 > > I sets : 32 > > D size : 32768 > > D assoc : 32 > > D line length : 32 > > D sets : 32 > > > > Hardware : The Gumstix Platform > > Revision : 0000 > > Serial : 328e1362e7af4134 > > > > I just need the serial number, not the preceding text or spaces. Any > ideas > > how this might be done? > > > > The closest I can get is to type "cat /proc/cpuinfo | grep Serial" > > > > Thanks! > > > > Ryan > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2005. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > gumstix-users mailing list > > gum...@li... > > https://lists.sourceforge.net/lists/listinfo/gumstix-users > > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > |
From: Jason <gu...@la...> - 2007-09-28 18:55:53
|
Ryan Pederson wrote: > Hi all, > > Quick one for you guys... > > I need to pull the serial number of the CPU of the gumstix from > /proc/cpuinfo. > > It's the very last line in the output: > > Processor : XScale-PXA255 rev 6 (v5l) > BogoMIPS : 397.31 > Features : swp half fastmult edsp > CPU implementer : 0x69 > CPU architecture: 5TE > CPU variant : 0x0 > CPU part : 0x2d0 > CPU revision : 6 > Cache type : undefined 5 > Cache clean : undefined 5 > Cache lockdown : undefined 5 > Cache format : Harvard > I size : 32768 > I assoc : 32 > I line length : 32 > I sets : 32 > D size : 32768 > D assoc : 32 > D line length : 32 > D sets : 32 > > Hardware : The Gumstix Platform > Revision : 0000 > Serial : 328e1362e7af4134 > > I just need the serial number, not the preceding text or spaces. Any > ideas how this might be done? > > The closest I can get is to type "cat /proc/cpuinfo | grep Serial" cat /proc/cpuinfo | grep Serial | sed -r -e 's/^Serial.+?: //' hth, Jason |
From: Heilpern, M. <mar...@au...> - 2007-09-28 19:07:28
|
awk '/Serial/ {print $3}' /proc/cpuinfo =20 =20 ________________________________ From: gum...@li... [mailto:gum...@li...] On Behalf Of Ryan Pederson Sent: Friday, September 28, 2007 2:39 PM To: gum...@li... Subject: [Gumstix-users] Pull CPU Serial from /proc/cpuinfo =20 Hi all, Quick one for you guys... I need to pull the serial number of the CPU of the gumstix from /proc/cpuinfo. It's the very last line in the output: Processor : XScale-PXA255 rev 6 (v5l)=20 BogoMIPS : 397.31 Features : swp half fastmult edsp CPU implementer : 0x69 CPU architecture: 5TE CPU variant : 0x0 CPU part : 0x2d0 CPU revision : 6 Cache type : undefined 5=20 Cache clean : undefined 5 Cache lockdown : undefined 5 Cache format : Harvard I size : 32768 I assoc : 32 I line length : 32 I sets : 32 D size : 32768=20 D assoc : 32 D line length : 32 D sets : 32 Hardware : The Gumstix Platform Revision : 0000 Serial : 328e1362e7af4134 I just need the serial number, not the preceding text or spaces. Any ideas how this might be done? The closest I can get is to type "cat /proc/cpuinfo | grep Serial" Thanks! Ryan NOTE: The information in this message is intended for the personal and = confidential use of the designated recipient(s) named above. To the extent the = recipient(s) is/are bound by a non-disclosure agreement, or other agreement that contains an = obligation of confidentiality, with AuthenTec, then this message and/or any = attachments shall be considered confidential information and subject to the confidentiality = terms of that agreement. If the reader of this message is not the intended recipient = named above, you are notified that you have received this document in error, and any = review, dissemination, distribution or copying of this message is strictly prohibited. If you = have received this document in error, please delete the original message and notify the = sender immediately. Thank you. AuthenTec, Inc. http://www.authentec.com |
From: John G. <jg...@wi...> - 2007-09-28 19:09:52
|
I love these contests... awk '/^Serial/{print $3}' /proc/cpuinfo On Friday 28 September 2007 14:39:07 Ryan Pederson wrote: > Hi all, > > Quick one for you guys... > > I need to pull the serial number of the CPU of the gumstix from > /proc/cpuinfo. > > It's the very last line in the output: > > Processor : XScale-PXA255 rev 6 (v5l) > BogoMIPS : 397.31 > Features : swp half fastmult edsp > CPU implementer : 0x69 > CPU architecture: 5TE > CPU variant : 0x0 > CPU part : 0x2d0 > CPU revision : 6 > Cache type : undefined 5 > Cache clean : undefined 5 > Cache lockdown : undefined 5 > Cache format : Harvard > I size : 32768 > I assoc : 32 > I line length : 32 > I sets : 32 > D size : 32768 > D assoc : 32 > D line length : 32 > D sets : 32 > > Hardware : The Gumstix Platform > Revision : 0000 > Serial : 328e1362e7af4134 > > I just need the serial number, not the preceding text or spaces. Any ideas > how this might be done? > > The closest I can get is to type "cat /proc/cpuinfo | grep Serial" > > Thanks! > > Ryan |
From: Pat W. <okh...@gm...> - 2007-09-28 20:14:17
|
..or another fun one: cat /proc/cpuinfo | sed -e 's/ //g' | awk -F: '{print $2}' That will eliminate the spaces around the serial and produce just a clean serial number. This is why I've loved Un*x for 24 years now...sooo many ways to skin a cat! :-D --Pat On 9/28/07, John Gorkos <jg...@wi...> wrote: > > I love these contests... > > awk '/^Serial/{print $3}' /proc/cpuinfo > > > > On Friday 28 September 2007 14:39:07 Ryan Pederson wrote: > > Hi all, > > > > Quick one for you guys... > > > > I need to pull the serial number of the CPU of the gumstix from > > /proc/cpuinfo. > > > > It's the very last line in the output: > > > > Processor : XScale-PXA255 rev 6 (v5l) > > BogoMIPS : 397.31 > > Features : swp half fastmult edsp > > CPU implementer : 0x69 > > CPU architecture: 5TE > > CPU variant : 0x0 > > CPU part : 0x2d0 > > CPU revision : 6 > > Cache type : undefined 5 > > Cache clean : undefined 5 > > Cache lockdown : undefined 5 > > Cache format : Harvard > > I size : 32768 > > I assoc : 32 > > I line length : 32 > > I sets : 32 > > D size : 32768 > > D assoc : 32 > > D line length : 32 > > D sets : 32 > > > > Hardware : The Gumstix Platform > > Revision : 0000 > > Serial : 328e1362e7af4134 > > > > I just need the serial number, not the preceding text or spaces. Any > ideas > > how this might be done? > > > > The closest I can get is to type "cat /proc/cpuinfo | grep Serial" > > > > Thanks! > > > > Ryan > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > |
From: Craig H. <cr...@gu...> - 2007-09-28 20:32:05
|
On Sep 28, 2007, at 11:39 AM, Ryan Pederson wrote: > Serial : 328e1362e7af4134 > > I just need the serial number, not the preceding text or spaces. > Any ideas how this might be done? > > The closest I can get is to type "cat /proc/cpuinfo | grep Serial" grep Serial /proc/cpuinfo | awk -F: '{print $2}' C |
From: Craig H. <cr...@gu...> - 2007-09-28 20:32:43
|
On Sep 28, 2007, at 12:07 PM, Heilpern, Mark wrote: > awk '/Serial/ {print $3}' /proc/cpuinfo > Mark wins. I always forget awk can do the pattern matching itself ;) C |
From: Ryan P. <ry...@pe...> - 2007-09-28 20:34:56
|
Right on, thanks! Now I've got 3 or 4 different ways of doing it... lol It's a little script that runs: awk '/Serial/ {print $3}' /proc/cpuinfo > /etc/hostname Now how do I get it to set the hostname immediately to /etc/hostname? This is all pretty simple stuff, but it seems to allude me today... Thanks again Ryan On 9/28/07, Craig Hughes <cr...@gu...> wrote: > > On Sep 28, 2007, at 12:07 PM, Heilpern, Mark wrote: > > awk '/Serial/ {print $3}' /proc/cpuinfo > > Mark wins. I always forget awk can do the pattern matching itself ;) > C > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > > |
From: Ryan P. <ry...@pe...> - 2007-09-28 20:38:27
|
Answered my own question... hostname -F /etc/hostname Sweet! On 9/28/07, Ryan Pederson <ry...@pe...> wrote: > > Right on, thanks! > Now I've got 3 or 4 different ways of doing it... lol > > It's a little script that runs: > > awk '/Serial/ {print $3}' /proc/cpuinfo > /etc/hostname > > Now how do I get it to set the hostname immediately to /etc/hostname? > > This is all pretty simple stuff, but it seems to allude me today... > > Thanks again > > Ryan > > > > On 9/28/07, Craig Hughes <cr...@gu...> wrote: > > > On Sep 28, 2007, at 12:07 PM, Heilpern, Mark wrote: > > > > awk '/Serial/ {print $3}' /proc/cpuinfo > > > > Mark wins. I always forget awk can do the pattern matching itself ;) > > C > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2005. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > gumstix-users mailing list > > gum...@li... > > https://lists.sourceforge.net/lists/listinfo/gumstix-users > > > > > |