therockmandolinist Posted May 1, 2016 Share Posted May 1, 2016 Trying to pass multiple paths from file action as args to a command in a bash script. Is there a way to do this? Link to comment
therockmandolinist Posted May 1, 2016 Author Share Posted May 1, 2016 Sorry, resolved (I think.) Used: IFS=$'\t' read -r -a filepath <<< "$filepath" my_command "${filepath[@]}" which I think worked, since multiple paths are tab separated. Link to comment
deanishe Posted May 1, 2016 Share Posted May 1, 2016 This should work. # Split tab-delimited query into an array query="{query}" oIFS="$IFS" IFS=$'\t' args=( $query ) IFS="$oIFS" # Replace with your command! echo "${args[@]}" luckman212 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now