I have the following code:
#!/bin/bash
FSTAB=` grep -vE "^#|swap|UUID" /etc/fstab | awk '{print $1,$2,$3}'`
for i in $FSTAB
do
echo "$i"
done
return this:
/dev/mapper/centos-root
/
xfs
/dev/sdb2
/hdos
xfs
The problem is that later I want to compare it, so I am returning it with line breaks and I want it to be returned in a single line without jumps, that is to say:
/dev/mapper/centos-root / xfs
/dev/sdb2 /hdos xfs