could any one tell me why the following code is not running when i m using
shell as interpreter but is running when i m using awk as interpreter
1 \#!/bin/sh
2
3 awk '
4
5 \{
6 if\(\(index\($1,"@"\) > 0\)\)
7 \{
8
9 i = index\($1,"@"\);
10 printf\("username is : %s\\n",substr\($1,1,i-1\)\);
11 printf\("site name is : %s\\n",substr\($1,i\+1,length\($1\)\)\);
12
13 \}
14
15
16 \}
17
18 '
~
~
~
but it is working when using
#!/bin/awk -f