以下はperlのコードです。同じことをシェルスクリプトで書けるでしょうか?? はいの場合、どのように?連想配列を使用しましたが、これが何をしているのかを達成できません
open MYFILE, "<", "$ARGV[0]" or die "Can't open $ARGV[0] file \n";
############ to retieve the info and put them in associative arrray ##############
$line = <MYFILE>;
@line1 = split(/,/ , $line);
$length = @line1;
$count = 0;
while($count < $length)
{
$line1[$count] =~ s/^\"//;
$line1[$count] =~ s/\"$//;
$count++;
}
$line = <MYFILE>;
@line2 = split(/,/ , $line);
$length = @line2;
$count = 0;
while($count < $length)
{
$line2[$count] =~ s/^\"//;
$line2[$count] =~ s/\"$//;
$count++;
}
$count = 0;
while($count < $length)
{
$array{$line1[$count]}=$line2[$count];
$count++;
}