Cut adding $ and carriage return characters for MAC addresses
I have go a different way with this script, but very curious about this.
First the script I am using Code:
cat mac.sh And the output: Code:
./mac.sh The bit I am curious about is: + HO2=$'00:23:AE:69:C0:F2\r' Anyone handy with text processing know about this? Thanks |
How did you create maclist.txt, on MSWin?
If so, you need to run dos2unix over it first to cvt MS line endings to Linux ones. |
chrism01 oh of course. So obvious now.
Our Windows guy here created it, so that explains the carriage return. But what about the prepended $ ? Its like a regex start of line, but why would cut add that [or grep]? |
It might be tr that's adding or such.
Code:
+ grep 00:23:AE:69:C0:F2 /mnt/altiris/maclist.txt |
So I converted the line endings with vi and now the $ is gone too.
So for some reason DOS line endings added $ at the beginning of the MAC address but not the hostname which is at the start of the line. Weird. |
All times are GMT -5. The time now is 07:31 AM. |