On 03/15/2016 03:56 AM, jdd wrote:
Le 14/03/2016 22:52, Uzair Shamim a écrit :
This seems to work on my system, you just have to escape the single quotes and add that $ at the start.
alias test=$'df | awk -F" " \'!_[$1]++\''
as you are much better as scripting than I am :-( you probably have a solution to the following goal.
I want to addto the df message the one from btrfs for completeness
that is add
/usr/sbin/btrfs fi df -h /
to the alias line, but what I tried didn't work :-(
thanks jdd
I don't know if you can one line it but here is a script to generate a report of df. Maybe not the cleanest solution but you can put it in a file and then set it in $PATH or as an alias. I'm not sure how to one line it.. #!/bin/bash df | awk -F" " '!_[$1]++' drives=$(df --type=btrfs | awk -F" " '!_[$1]++' | awk -F" " '{if (NR!=1) {print $6}}') for drive in $drives; do echo "" echo "== Status For Drive $drive ==" btrfs fi df $drive done -- Regards, Uzair Shamim