Hello, I have a piece of bash code I'm using to list all running db instances on logon to server. It runs quite slowly, annoyingly delaying logon. I need to grep uncommented lines, get first column and alphabetically sort it, this is core of the command:
grep '^[A-Z]' /var/opt/oracle/oratab | awk -F: '{print $1}' | sortI was thinking about using perl oneliner but I am not really good with that and I am not even sure if it will run faster. Anyone would be willing to show me how? Is it even a good idea?
/edit: I should show what I started with:
perl -lane 'print if /^[A-Z]/;' /var/opt/oracle/oratabThis is to grep but now I need to add next step (awk) and I'm not sure what's the right syntax.
In reply to Parse a text file with oneliner by RenMcCourtey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |