venhart
1
Trying to run the following awk command :
export com.mics.ara.server.tools.sch_reports.Runner.num_threads=`awk -F= '!/^#/ && /com.mics.ara.server.tools.sch_reports.Runner.num_threads/{print $2}' $BKUPDIR/env.properties`
-bash: export: `com.mics.ara.server.tools.sch_reports.Runner.num_threads=': not a valid identifier
but i'm getting the following error message as per above ?
yazu
2
- Try:
com.mics.ara.server.tools.sch_reports.Runner.num_threads=1
- Think about the result.
- Learn the basics of the shell.
venhart
3
ok my question is :
I have a value within a file :
aaa.ddd.ccc.ddd.eee.fff=5
how do I create a variable from the above line so I can pass it to another file. But I only need the value 5 as the variable.
thank you
$ echo "aaa.ddd.ccc.ddd.eee.fff=5" | awk '{ split($0, A, "="); printf("var=%s\n", A[2]); }'
var=5
$
venhart
5
thank you, now if my line is this below
com.data.ara.reportserver.tools.sch_reports.ReportRunner.num_threads=5
how would I do this ?
why don't you apply the same logic as above and try out?
--ahamed
Exact same way. It splits on '=' so it ignores everything before the =.