fixed issue with windows format : removal by sed

This commit is contained in:
eth-man 2019-11-16 03:38:44 +01:00
parent 25b3aa275e
commit f3654ec06a

View File

@ -11,17 +11,17 @@ mac=$1
unix() { unix() {
# Unix Format # Unix Format
var=$( echo $mac | sed 's![-.]!!g;s!\(..\)!\1:!g;s!:$!!') ; var=$( echo $mac | sed 's![-.:]!!g;s!\(..\)!\1:!g;s!:$!!') ;
} }
cisco() { cisco() {
# Cisco Format # Cisco Format
var=$( echo $mac | sed 's![-.]!!g;s!\(....\)!\1.!g;s!.$!!') ; var=$( echo $mac | sed 's![-.:]!!g;s!\(....\)!\1.!g;s!.$!!') ;
} }
windows() { windows() {
# Windows Format # Windows Format
var=$( echo $mac | sed 's![-.]!!g;s!\(..\)!\1-!g;s!-$!!') ; var=$( echo $mac | sed 's![-.:]!!g;s!\(..\)!\1-!g;s!-$!!') ;
} }
choice=$(printf "Unix\\nCisco\\nWindows" | dmenu -i -p "Select required MAC format:") choice=$(printf "Unix\\nCisco\\nWindows" | dmenu -i -p "Select required MAC format:")