I have a script I am working on that I need to cut out part of the output from a command. For example:
I know about the
Code:
#! /bin/bash
blkid
read -p "Enter the drive from the list above (example: /dev/sda1): " drive
blkid | grep $drive # <-- This is where I am stuck. I want to sort out the UUID, PARTUUID, and the TYPE of filesystem
echo "UUID="$uuid" /home/Documents "$format" defaults,nofail 0 0" | sudo tee -a /etc/fstab
I know about the
sed
command, but I have no idea on how to use it. Any suggestions?