I have an awk script:
BEGIN { FS="_" }
/^>/ {
id=$1;p=$2; wild=$3;subs=$4; c=$NF; next
}
{
if (p-10<1) s=1
else if (p+10>length($0)) s=length($0)-20
else s=p-10
print id"_"p"_"wild"_"subs">\n"substr($0,s,p-s) c substr($0,p+1,21-p+s)
}
and when I run I get the following:
$ cat test1.fasta | awk -f snp_flank.awk
bash: /usr/bin/awk: /usr/bin/awk: bad interpreter: Too many levels of symbolic links
what does this mean?
extra info:
$ ls -l /usr/bin/awk
lrwxrwxrwx 1 root root 21 2011-12-07 16:47 /usr/bin/awk -> /etc/alternatives/awk
$ head -n10 /usr/bin/awk
#!/usr/bin/awk -f
BEGIN { FS="_" }
/^>/ {
id=$1;p=$2; wild=$3;subs=$4; c=$NF; next
}
{
if (p-10<1) s=1
else if (p+10>length($0)) s=length($0)-20
else s=p-10
it appears I have accidentally replaced awk with an awk script! sorry! how do I fix this? would simply reinstalling awk sort this out?
/usr/bin/awkon that system? What dofile /usr/bin/awkandhead -n1 /usr/bin/awksay?ls -l /usr/bin/awk? Is this file a symbolic link to another file? I think there is a link loop.root. Make sure no-one except root can modify the directory/usr/bin(or/bin,/sbin,/usr/sbin,/etc, etc), and that no-one except root can modify the files in those directories. You should not be able to overwrite/usr/bin/awkrunning as an ordinary mortal user.