awk -F, ' # use , as input field separator
{ # use array a index by $1 and value of indexed entry is built by
# concatenating $3 to it separated by the value of OFS (space by default)
#a[$1]=($1 in a)? a[$1] OFS $3:$3
# the above can be rewritten as
if ($1 in a)
a[$1] = a[$1] OFS $3
else
a[$1]=$3
}
END {
# iterate through array a indexed by i - outputting a string script followed by
# OFS (OutFieldSeparator - space by default), followed by value of array entry
# iterated by i, followed by OFS and followed by the value of current iterator i.
# iterator is the value of column $1
for (i in a)
print "script" OFS a OFS i
}' myFile