• + 0 comments

    $( ) is for command subsitution, it moves output of cat command to an array. In here :

    # $(cat) == $(cat $1) 
    

    cause the input is a file and you should use cat to get the file contents. for example for defining an array from all the files in the current directory, you can use this:

    arr=($(ls .))