Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

argument in awk takes on the argument passing into bash script

User_U1UYAFeb 17 2021

Hi everybody,
To run my script: myscript copy -t "2011-11-11" -s 3
<-- the 2nd $OPTARG is "2011-11-11", so inside the script the awk calls for $2 and it took up the argument passed in instead of the 2nd column from free -g.
oth=$(free -g | grep 'Mem' | awk '{print $2}')
Please help.

Thanks

Comments

Processing

Post Details

Added on Feb 17 2021
1 comment
18 views