How can i cut with sed the following property to have only MAC
?
MAC evbyminsd58df
I did this but it works in the other side:
sed -e 's/^.\{1\}//'
Just remove everything from the space:
$ echo "MAC evbyminsd58df" | sed 's/ .*//'
MAC
As you mention cut, you can use cut
selecting the first field based on space as separator:
$ echo "MAC evbyminsd58df" | cut -d" " -f1
MAC
With pure Bash, either of these:
$ read a _ <<< "MAC evbyminsd58df"
$ echo "$a"
MAC
$ echo "MAC evbyminsd58df" | { read a _; echo "$a"; }
MAC
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With