diff --git a/shell/alias/lsblk.sh b/shell/alias/lsblk.sh index 4d63193..fb50d87 100644 --- a/shell/alias/lsblk.sh +++ b/shell/alias/lsblk.sh @@ -1,12 +1,27 @@ # list block devices -alias lb="\ -lsblk \ ---output \"NAME,SIZE,TYPE,FSTYPE,LABEL,MOUNTPOINTS\" \ ---noempty \ -" +lb() { + lbo \ + "SIZE" \ + "TYPE" \ + "FSTYPE" \ + "LABEL" \ + "MOUNTPOINTS" +} -# list block devices (old) -alias lbo="\ -lsblk \ ---output \"NAME,SIZE,TYPE,FSTYPE,LABEL,MOUNTPOINT\" \ -" +# common arguments +lbc() { + lsblk \ + --noempty \ + "${@}" +} + +# output arguments +lbo() { + local argument + local arguments="NAME" + for argument in "${@}"; do + arguments="${arguments},${argument}" + done + lbc \ + --output "${arguments}" +}