1

I've tried to write the following code in bash but I am not able to get the output to be echoed.

part1="blkid | grep -P 'CENTOS 7' | cut -c1-9"
echo "$part1"
TrebledJ
  • 8,713
  • 7
  • 26
  • 48
Niv
  • 27
  • 3

1 Answers1

2

Try this

part1=$(blkid | grep -P 'CENTOS 7' | cut -c1-9)
echo "$part1"
Nima Hejazi
  • 151
  • 3