Sponsored Content
Special Forums IP Networking Configure IP Based on HW Serial # Post 302562004 by injector on Wednesday 5th of October 2011 05:03:32 PM
Old 10-05-2011
Quote:
Originally Posted by bartus11
Try:
Code:
serial=`sudo /usr/sbin/dmidecode -t 1 | grep -e 'Serial Number' | cut -f 2`
if [ $serial=="1234" ]; then
  ifconfig eth0 inet 1.1.1.1/8
fi

bartus, that works wonderfully but when i execute it as a script it tells me

Code:
[root@localhost Desktop]# ./test
./test: line 2: [: Number:: binary operator expected

could it have something to do with the fact that the serial number contains letters too?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

serial communication

This isn't really a unix question, or even a programming question, but I hope you guys can help. I want to create a program to control the electricity on a model railway. I have created the program to that it sends characters over the serial cable, but now I need to do the switch that will... (1 Reply)
Discussion started by: KrazyGuyPaul
1 Replies

2. IP Networking

TCP over serial

Here's my config: One quadra 840av working under netBSD and successfully connected to my network. One PM 6100 connected but not booting fully into netBSD (i realize this is faulty but I figured it was worth a shot to try and install netBSD/mac68k on it due to the fact it is unsupported under the... (1 Reply)
Discussion started by: Yummator
1 Replies

3. Programming

What is the difference between console-based and xwindow-based application?

Hi everyone, What is the difference between console-based and Xwindow-based application? Can I say the application working well in Xwindows can work in console? Can I say the application working well in console cann't work in Xwindow perhaps. Eg, ncurses is console-based and Imlib2 is... (4 Replies)
Discussion started by: liuyan03
4 Replies

4. Ubuntu

Ubuntu 9.04 Serial application to telnet to serial device

Hello! I am working on an application which reads environmental instruments which have serial ports. The application requires a serial port to be present to talk to the device (i.e. /dev/ttyS0 ). In some instances the environmental devices will be 100's of yards away from the computer, so a... (5 Replies)
Discussion started by: mvona
5 Replies

5. Shell Programming and Scripting

How to fetch rows based on line numbers or based on the beginning of a word?

I have a file which will have rows like shown below, ST*820*316054716 RMR*IV*11333331009*PO*40.31 REF*IV*22234441009*xsss471-2762 DTM*003*091016 ENT*000006 RMR*IV*2222234444*PO*239.91 REF*IV*1234445451009*LJhjlkhkj471-2762 </SPAN> DTM*003* 091016 RMR*IV*2223344441009*PO*40.31... (18 Replies)
Discussion started by: Muthuraj K
18 Replies

6. Shell Programming and Scripting

Need help with serial port

Hi, I have a external board connected to my serial port. I need to execute "shutdown -r now" command when system boot up. When system boots up it requires a username ans password. Then I need to run my command. I can use rc script but that is rebooting system before it asks for username and... (0 Replies)
Discussion started by: charlie.arya
0 Replies

7. UNIX for Advanced & Expert Users

Transition from Windows-based network to Linux-based

I am looking to make the switch from a Windows based network to a Linux (preferably Ubuntu, because I used it the most) based one. Currently the network includes a Windows 2003 server which acts as a domain controller and file server, a network shared printer (Canon 2300N) and 7 clients running... (2 Replies)
Discussion started by: larynx
2 Replies

8. HP-UX

Help with serial ports.

Hi, This is my first post here. I would like to ask: how to connect the barcode scanner to the serial port? What are the names in the system (in / dev) and serialport1 serialport0? Please help with this. Regards. (2 Replies)
Discussion started by: ftwojtek
2 Replies

9. Solaris

Can we configure link based IPMP in private connectivity in Oracle RAC

Hi I would like to know whether we can configure link based IPMP in private connectivity in Oracle RAC Regarsd ---------- Post updated at 04:35 PM ---------- Previous update was at 04:27 PM ---------- Here I am taking about in case of private connectivity through cross cable (6 Replies)
Discussion started by: sb200
6 Replies

10. UNIX for Dummies Questions & Answers

Condition based on Timestamp (Date/Time based) from logfile (Epoch seconds)

Below is the sample logfile: Userids Date Time acb Checkout time: 2013-11-20 17:00 axy Checkout time: 2013-11-22 12:00 der Checkout time: 2013-11-17 17:00 xyz Checkout time: 2013-11-19 16:00 ddd Checkout time: 2013-11-21 16:00 aaa Checkout... (9 Replies)
Discussion started by: asjaiswal
9 Replies
VPDDECODE(8)						      System Manager's Manual						      VPDDECODE(8)

NAME
vpddecode - VPD structure decoder SYNOPSIS
vpddecode [OPTIONS] DESCRIPTION
vpddecode prints the "vital product data" information that can be found in almost all IBM and Lenovo computers. Available items are: o BIOS Build ID o Box Serial Number o Motherboard Serial Number o Machine Type/Model Some systems have these additional items: o BIOS Release Date o Default Flash Image File Name Note that these additional items are not documented by IBM, so this is guess work, and as such should not be blindly trusted. Feedback about the accuracy of these labels is welcome. OPTIONS
-d, --dev-mem FILE Read memory from device FILE (default: /dev/mem) -s, --string KEYWORD Only display the value of the VPD string identified by KEYWORD. KEYWORD must be a keyword from the following list: bios-build-id, box-serial-number, motherboard-serial-number, machine-type-model, bios-release-date. Each keyword corresponds to an offset and a length within the VPD record. Not all strings may be defined on all VPD-enabled systems. If KEYWORD is not provided or not valid, a list of all valid keywords is printed and vpddecode exits with an error. This option cannot be used more than once. Mutually exclusive with --dump. -u, --dump Do not decode the VPD records, dump their contents as hexadecimal instead. Note that this is still a text output, no binary data will be thrown upon you. ASCII equivalent is displayed when possible. This option is mainly useful for debugging. Mutually exclu- sive with --string. -h, --help Display usage information and exit -V, --version Display the version and exit FILES
/dev/mem AUTHOR
Jean Delvare SEE ALSO
biosdecode(8), dmidecode(8), mem(4), ownership(8) dmidecode February 2007 VPDDECODE(8)
All times are GMT -4. The time now is 04:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy