[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Taming the "lsblk" command



On Wed 09 Jan 2019 at 07:51:31 (-0500), Felix Miata wrote:
> Jude DaShiell composed on 2019-01-09 06:48 (UTC-0500):
> 
> > Felix Miata wrote:
> 
> >> Jude DaShiell composed on 2019-01-09 00:04 (UTC-0500):
> 
> >>> lsblk -l -o name,label | sort | script
> 
> >> I tried exactly that on Buster multiple times, and always get the following:
> 
> >> root@gb250:~# NAME  LABEL
> >> bash: NAME: command not found
> >> root@gb250:~# sda
> >> bash: sda: command not found
> >> root@gb250:~# sda10 k25p10deb10
> >> bash: sda10: command not found
> >> root@gb250:~# sda11 k25p11deb10fat
> >> bash: sda11: command not found
> ...
> >> root@gb250:~# sda8  k25p08s150
> >> bash: sda8: command not found
> >> root@gb250:~# sda9  k25p09s151
> >> bash: sda9: command not found
> >> root@gb250:~# sr0
> >> bash: sr0: command not found
> >> root@gb250:~# exit
> 
> > That can happen if bash doesn't find sort in its default binary
> > directory.  Could be pointing bash directly at sort will clear the
> > command not found error out of the output.
> 
> # cat /etc/debian_version
> buster/sid
> # which sort
> /usr/bin/sort
> # which script
> /usr/bin/script
> 
> Same result from:
> 
> 	lsblk -l -o name,label | /usr/bin/sort | /usr/bin/script

You've attempted to run a shell using the output of lsblk as a series
of commands for it to execute.

Cheers,
David.


Reply to: