#!/bin/bash # Serch And Play ! player=qmmp player_args= snp() { if [[ -n $1 ]] then string=$1 else read -p "SEARCH: " string fi IFS_BAK=$IFS IFS=$'\n' files=() for file in $(ls | grep -i "$string"); do files+=("$file") # Ajoute le fichier au tableau done setsid $player $player_args "${files[@]}" 2>/dev/null & # Passe chaque élément séparément à qmmp IFS=$IFS_BAK }