How to validate the following file content?
That should be include single integer/float number by bash Regular Expression or any other idea with awk/sed.
example:
cat /var/VERSION/Version_F35_project_usa
2.8
awkbashlinuxregular expressionsed
How to validate the following file content?
That should be include single integer/float number by bash Regular Expression or any other idea with awk/sed.
example:
cat /var/VERSION/Version_F35_project_usa
2.8
Best Answer
Use
grep
, if matched means that's valid:The above regex can be used in
sed
orawk
or any command.Here is also checking if file match with this regex or not.