Remove Array Duplicates

Remove duplicate values from an array while preserving the original order of first occurrences.

Code

General
echo "$arr" | tr -d '[]"' | tr ',' '\n' | awk '!seen[$0]++' | tr '\n' ' ' | sed 's/ $//'

Parameters

JSON array with duplicates

Server

More Bash Snippets