user3463055
user3463055

Reputation: 131

UNIX: variable inside variable

I just try to put variable inside variable but it doesn't work... How can i Fix it?

DEL=$(find . -type f | sed "s/^.*\///g" | sed -n '/\./p' | sed "s/.*\.//g" | uniq)
EL=$(${DEL} | tr '\n' ',' | sed 's/,$//')

Upvotes: 0

Views: 52

Answers (1)

Ren
Ren

Reputation: 2946

You can try

EL=$(tr '\n' ',' <<< "$DEL" | sed 's/,$//')

or

EL=$(echo "$DEL" | tr '\n' ',' | sed 's/,$//')

Upvotes: 1

Related Questions