Hello everyone and thanks for your support!
I'm facing a problem while using REGEX inside a bash script through =~ operand.
Environment: GNU bash, version 4.1.7(1)-release (powerpc-ibm-aix5.1.0.0)
bash-4.1$ if [[ a =~ a ]]; then echo match; fi
Segmentation fault(coredump)
The bash version:
bash-4.1$ bash --version
GNU bash, version 4.1.7(1)-release (powerpc-ibm-aix5.1.0.0)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
I'm looking for the best way to identify if a given argument is an integer because I need to be sure the given argument is a PID (process id) In Linux i always use =~
I have not been able to find solutions. I've searched online but can't find anything similar.
Thank you in advance
ps -p "${a}" &> /dev/nulland test exit status${?}.