Monday, April 22, 2024

grep for all database names in /etc/oratab

The file /etc/oratab contains:
#
mydb01:/orainst/product/19c:Y
cdb:/orainst/product/19c:N
To extract the database names:
grep "^[^#]" /etc/oratab | awk -F':' '{print $1}'
Result:
mydb01
cdb

No comments:

Post a Comment