-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Is your feature request related to a problem? Please describe.
This is not a problem and should be considered an enhancement idea.
Describe the solution you'd like
I'd like to make one of the parsing expressions more concise and possibly shave a few milliseconds off by using awk for most if not all of the expression.
π― Though for me to reliably submit a PR with the modification for Arista's review I'll need an example ACCESS_INFO.yaml file.
π (Bogus data as long as it is formatted the same as an actual file is sufficient. Please π)
Could one of the Arista team please share the format of /etc/atd/ACCESS_INFO.yaml?
Describe alternatives you've considered
One option is to parse with awk and pipe that to cut, but it may be possible to perform with just awk.
PROJECT=$(awk '/project/{print $1}' /etc/atd/ACCESS_INFO.yaml | cut -d':' -f2)
I'm open to other suggestions.
Additional context
(What was done here isn't wrong, but does pipe through several commands. I'd like to hack on it to try and make a shorter expression.)
| PROJECT=$(cut -d':' -f2 <<<$(grep project /etc/atd/ACCESS_INFO.yaml) | awk '{print $1}') |