From ca0399d4f35bf2e40858ffb2db8e96755f2ea7cf Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 16 Nov 2024 15:53:58 +0100 Subject: [PATCH] lb,lbc,lbo --- shell/alias/lsblk.sh | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) 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}" +}