I have those strings
gcc-4.8.3-1.aix7.1.ppc.rpm
gcc-c++-4.8.3-1.aix7.1.ppc.rpm
gcc-cpp-4.8.3-1.aix7.1.ppc.rpm
gcc-gfortran-4.8.3-1.aix7.1.ppc.rpm
libgcc-4.8.3-1.aix7.1.ppc.rpm
I want to cut starting from ".aix7.1" to end to obtain
gcc-4.8.3-1
gcc-c++-4.8.3-1
gcc-gfortran-4.8.3-1
libgcc-4.8.3-1
Plese,how to do this with awk?
awk -F'.aix7.1' '{print $1}'But there is more appropriate solutons withsedandbash variables.) in the field separator should better be escaped\\.since theFSis a regexp.aix7is just enough to sure indicate where to separate the line, so for simplity OP can leave.as is (even if it can be treat asany symbol)