0

I wrote a script to get sequences corresponding to some id's.

    # Process each genome ID in array
    for id in "${genome_ids[@]}"; do
        echo "Processing genome ID: $id"
        # Construct the command
        command="p3-genome-fasta --protein $id"
    # Execute the command
    $command 

Example output: Processing genome ID: 1000289.10 p3-genome-fasta --protein 1000289.10 . at /usr/share/bvbrc-cli/deployment/plbin/p3-genome-fasta.pl line 47.

It says there's an error, but when I copy and paste the command printed to the screen, it works?

Related code from p3-genome-fasta.pl

# Get the genome ID.
my ($genomeID) = @ARGV;
if (! $genomeID) {
    die "No genome ID specified.";
} elsif (! ($genomeID =~ /^\d+\.\d+$/)) {
    die "Invalid genome ID $genomeID.";
}

1 Answers1

0

Just an update for everyone. I managed to solve it. I had created the text file in windows and had CRLF characters. Managed to fix it by running dos2unix command.