On 2/27/22 12:26 PM, centos at niob.at wrote:> Am 27.02.22 um 04:33 schrieb Robert Nichols:
>> Does anything for CentOS 8 provide the function of the fstab-decode
utility?
>> Entries in /proc/mounts and /etc/fstab can have escape sequences for
certain special characters, and I need to decode that.
> 
> Preface: Never heard of fstab-decode before. Researching the command made
me really wonder why it was invented. Especially since I have never seen an
/etc/fstab with "escape sequences" or "special characters"
since at least 1990 (If I am wrong: Please show me such a fstab file).
> 
> So why not just use:
> 
>  ????umount $(awk '$3 == "vfat" {print $2}' /etc/fstab)
> 
> instead of the seemingly canonical use of fstab-decode
> 
>  ????fstab-decode umount $(awk '$3 == "vfat" { print $2
}' /etc/fstab)
Those samples break if the mount point directory name contains spaces, tabs, or
whatever other characters I don't know about that also get represented by
escape sequences. I'm not actually using it with /etc/fstab, but with
/proc/mounts which uses the same convention. I can control /etc/fstab and avoid
the problem, but I cannot control how some auto-mounted foreign filesystem might
be named. I have a script that needs to be robust in the face of such names.
-- 
Bob Nichols     "NOSPAM" is really part of my email address.
                 Do NOT delete it.