Sha256: 8cae1bb52cccbf07f6dc1b805a999da56996aeea278953e2998be527b4375cb6

Contents?: true

Size: 503 Bytes

Versions: 96

Compression:

Stored size: 503 Bytes

Contents

#!/usr/bin/env bash

input="$1";

a=0
c=0
g=0
t=0

function end() {
        echo "A: ${a}"
        echo "C: ${c}"
        echo "G: ${g}"
        echo "T: ${t}"
	exit
}

if [ ! -n "$input" ]; then
	end
fi

for i in $(seq 1 ${#input}); do
	char=${input:i-1:1}
	if [ "${char}" = "A" ]; then
		a=$((a+1))
	elif [ "${char}" = "C" ]; then
		c=$((c+1))
	elif [ "${char}" = "G" ]; then
		g=$((g+1))
	elif [ "${char}" = "T" ]; then
		t=$((t+1))
	else
		echo "Invalid nucleotide in strand"
		exit 1
	fi
done

end

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
trackler-2.2.1.139 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.138 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.137 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.136 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.135 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.134 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.133 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.132 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.131 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.130 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.129 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.128 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.127 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.126 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.125 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.124 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.123 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.122 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.121 tracks/bash/exercises/nucleotide-count/example.sh
trackler-2.2.1.120 tracks/bash/exercises/nucleotide-count/example.sh