Code Monkey home page Code Monkey logo

Comments (4)

mojombo avatar mojombo commented on June 24, 2024

This works for me on OSX and Debian Linux. What operating system are you on? The reason that a space is included in the regex is so that a mount_point of /rw would not accidentally match something like /lib/init/rw.

from god.

anlek avatar anlek commented on June 24, 2024

Actually, I might have been wrong. I tested the command on Ubuntu and it didn't return a correct result and after I read a few blogs and tested it again a few weeks later, it worked fine. So please close off the issue.

from god.

fguillen avatar fguillen commented on June 24, 2024

I have the same problem than anlek has before.

Ubuntu 10.4

$ df -P | grep sda1
/dev/sda1             19610300   3112624  15700760      17% /

Actual regex:
$ df -P | grep -i " /dev/sda1$" | awk '{print $5}' | sed 's/%//'
$ (none results)

Modified regex:
$ df -P | grep -i "^/dev/sda1 " | awk '{print $5}' | sed 's/%//'
$ 17

Thanks for your work

f.

from god.

fguillen avatar fguillen commented on June 24, 2024

I don't know if it could be a good idea to modify the valid? method so it could test that the regex responds with not empty result.

from god.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.