LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Simple Bash script for reading size of Volume groupe. (https://www.linuxquestions.org/questions/linux-newbie-8/simple-bash-script-for-reading-size-of-volume-groupe-4175616290/)

allend 10-24-2017 06:44 PM

Quote:

File=$(df /somefile | grep / | awk '{ print $5}' | sed 's/%//g')
The grep | awk | sed pipline is unnecessary. Just use awk.
e.g.
Code:

File=$(df | awk '/somefile/ {print gensub(/%/,"",1,$5)})'
Adding the volume is easy.


All times are GMT -5. The time now is 07:41 AM.