Fix multiple spaces in `ls` output's datetimes

master
BrainwreckedTech 3 years ago
parent d24fe1f1c4
commit 0f6348e0a1

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# GET THE INITITAL OUTPUT OF `ls /sys/block` # GET THE INITITAL OUTPUT OF `ls /sys/block`
BLK_INFO="$(ls -l --color=never /sys/block | grep -v virtual | grep devices | cut -d\ -f9-)" BLK_INFO="$(ls -l --color=never /sys/block | grep -v virtual | grep devices | sed 's/ \+/ /g' | cut -d\ -f9-)"
# STRIP OFF THE PCI BUS LOCATION INFORMATION # STRIP OFF THE PCI BUS LOCATION INFORMATION
BLK_INFO="$(echo "${BLK_INFO}" | sed 's|\.\.\/devices/pci[0-9a-f:]\{7\}\(/[0-9a-f:.]\{12\}\)\+/||g')" BLK_INFO="$(echo "${BLK_INFO}" | sed 's|\.\.\/devices/pci[0-9a-f:]\{7\}\(/[0-9a-f:.]\{12\}\)\+/||g')"

Loading…
Cancel
Save