LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-30-2010, 07:37 AM   #1
cold
Member
 
Registered: Feb 2004
Posts: 34

Rep: Reputation: 15
sed: how to change MAC address string with sed


Hello *,
please I need to know how can I change the MAX address string using sed. What I need is to add or subtract number from MAC address, e.g.

Input string:
ethaddr=00:21:04:4D:BB:00

Output string
ethaddr=00:21:04:4D:BB:05

Sorry for bugging but I don't have enough time to study the solution by myself and I'm not experienced with sed :-(.

Many thanks in advance.
jn.
 
Old 07-30-2010, 08:31 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
I don't have enough time to study the solution by myself and I'm not experienced with sed
....and, by implication, you also don't have time to learn SED?
This is not a good way to get help here....

First, you don't say what the criteria is for making a change. For example, is it always the last portion that needs to be changed? Do we need to test and sure the target number is part of a MAC? ....etc.

Second, why SED? If you set the the field separator to ":", then AWK is very handy for discriminating columns.
 
Old 07-30-2010, 10:52 AM   #3
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 547

Rep: Reputation: 115Reputation: 115
Quote:
I don't have enough time to study the solution by myself and I'm not experienced with sed
And I don't have enough time to help you either.
 
0 members found this post helpful.
Old 07-30-2010, 03:31 PM   #4
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu
Posts: 1,225

Rep: Reputation: 251Reputation: 251Reputation: 251
I have the time, and I know enough about awk (but not sed) to be able to accomplish the task, but I don't have enough time to post the solution
 
0 members found this post helpful.
Old 08-02-2010, 03:22 AM   #5
cold
Member
 
Registered: Feb 2004
Posts: 34

Original Poster
Rep: Reputation: 15
Guys,
I didn't have time to learn SED (no AWK on board) since I had some tight deadlines when this task had to be finished. Please if you don't want to help, don't start flames here.
 
Old 08-02-2010, 07:43 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Sorry, cold, but you started it.

If you read the thread, you'll see that I did want to help----I asked you a question which you apparently did not have time to answer. (My post was less than an hour after your started the thread.)

Quote:
I had some tight deadlines when this task had to be finished.
Why is this our problem?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sed (or something): how to delete a MAC address from a line? recomboDNA Programming 6 07-23-2010 03:09 AM
Using sed to change everything apart from one string deathalele Programming 2 03-22-2009 12:55 PM
sed substituting string freeindy Programming 3 12-24-2008 05:05 AM
Trying to change String using sed with a string \/home\/user\/Desktop icecoolcorey Programming 10 06-12-2008 11:32 PM
sed replace string octeto Programming 4 06-06-2007 02:09 AM


All times are GMT -5. The time now is 08:03 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration