hi all,
Can any 1 help me translate this korn shell code to C shell code :
email=$(grep "^$1" $folder/config_2.txt | awk '{print $2'})
In config_2.txt the content is :
which mean in korn shell , $1=groupname and $2=email address.
Now i need to write in C shell script,when i set the value as variable while be like this:
Compare to Korn shell,when set as variable is like this:
danmero
September 26, 2010, 3:26pm
2
proghack:
hNow i need to write in C shell script,when i set the value as variable while be like this:
var[1] = group1
var[2] = alan@gmail.com
var[3] = group2
var[4] = susan@email.com
var[5] = group3
var[6] = alice@gmail.com
#!/bin/csh
set array = `tr \\\n \ < file`
echo $array[1]
echo $array[6]
hi danmero,
wht u mean by this part :
set array = `tr \\\n \ < file
for this ksh code :
email=$(grep "^$1" $folder/config_2.txt | awk '{print $2'})
The output should be like this :
Actually it mean read row by row and column.