# awk command - not a valid identifier message

**URL:** <https://community.unix.com/t/awk-command-not-a-valid-identifier-message/295138>\
**Category:** Shell Programming and Scripting\
**Created:** [September 12, 2011, 11:18am UTC](https://community.unix.com/t/awk-command-not-a-valid-identifier-message/295138 "2011-09-12T11:18:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![venhart](https://community.unix.com/letter_avatar/venhart/32/6_22734026db12803ebb3e059622ac3534.png) [@venhart](https://community.unix.com/u/venhart)\
**Post date:** [September 12, 2011, 11:18am UTC](https://community.unix.com/t/awk-command-not-a-valid-identifier-message/295138/1 "2011-09-12T11:18:33Z")

</div>

Trying to run the following awk command :

```nohighlight
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 ?

---

<div class="post-metadata">

**Author:** ![yazu](https://community.unix.com/user_avatar/community.unix.com/yazu/32/7048_2.png) [@yazu](https://community.unix.com/u/yazu)\
**Post date:** [September 12, 2011, 11:32am UTC](https://community.unix.com/t/awk-command-not-a-valid-identifier-message/295138/2 "2011-09-12T11:32:28Z")

</div>

1. Try:

```nohighlight
com.mics.ara.server.tools.sch_reports.Runner.num_threads=1

```

1. Think about the result.
2. Learn the basics of the shell.

---

<div class="post-metadata">

**Author:** ![venhart](https://community.unix.com/letter_avatar/venhart/32/6_22734026db12803ebb3e059622ac3534.png) [@venhart](https://community.unix.com/u/venhart)\
**Post date:** [September 12, 2011, 11:49am UTC](https://community.unix.com/t/awk-command-not-a-valid-identifier-message/295138/3 "2011-09-12T11:49:27Z")

</div>

ok my question is :

I have a value within a file :

```nohighlight
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

---

<div class="post-metadata">

**Author:** ![Corona688](https://community.unix.com/letter_avatar/corona688/32/6_22734026db12803ebb3e059622ac3534.png) [@Corona688](https://community.unix.com/u/Corona688)\
**Post date:** [September 12, 2011, 11:52am UTC](https://community.unix.com/t/awk-command-not-a-valid-identifier-message/295138/4 "2011-09-12T11:52:05Z")

</div>

```nohighlight
$ echo "aaa.ddd.ccc.ddd.eee.fff=5" | awk '{ split($0, A, "="); printf("var=%s\n", A[2]); }'
var=5
$

```

---

<div class="post-metadata">

**Author:** ![venhart](https://community.unix.com/letter_avatar/venhart/32/6_22734026db12803ebb3e059622ac3534.png) [@venhart](https://community.unix.com/u/venhart)\
**Post date:** [September 12, 2011, 12:03pm UTC](https://community.unix.com/t/awk-command-not-a-valid-identifier-message/295138/5 "2011-09-12T12:03:03Z")

</div>

thank you, now if my line is this below

```nohighlight
 
com.data.ara.reportserver.tools.sch_reports.ReportRunner.num_threads=5
 

```

how would I do this ?

---

<div class="post-metadata">

**Author:** ![ahamed101](https://community.unix.com/user_avatar/community.unix.com/ahamed101/32/1118_2.png) [@ahamed101](https://community.unix.com/u/ahamed101)\
**Post date:** [September 12, 2011, 12:06pm UTC](https://community.unix.com/t/awk-command-not-a-valid-identifier-message/295138/6 "2011-09-12T12:06:42Z")

</div>

why don't you apply the same logic as above and try out?

--ahamed

---

<div class="post-metadata">

**Author:** ![Corona688](https://community.unix.com/letter_avatar/corona688/32/6_22734026db12803ebb3e059622ac3534.png) [@Corona688](https://community.unix.com/u/Corona688)\
**Post date:** [September 12, 2011, 12:37pm UTC](https://community.unix.com/t/awk-command-not-a-valid-identifier-message/295138/7 "2011-09-12T12:37:24Z")

</div>

> [@venhart](#):
>
> thank you, now if my line is this below
> 
> ```plaintext
>  
> com.data.ara.reportserver.tools.sch_reports.ReportRunner.num_threads=5
>  
> 
> ```
> 
> how would I do this ?

Exact same way. It splits on '=' so it ignores everything before the =.
