I see in a shell script code like:
for i in $(seq 1 5); do
# do something
done
I am used to writing same logic as:
for i in `seq 1 5 | xargs`; do
# do something
done
Is there a difference between both the approaches?
I see in a shell script code like:
for i in $(seq 1 5); do
# do something
done
I am used to writing same logic as:
for i in `seq 1 5 | xargs`; do
# do something
done
Is there a difference between both the approaches?
This $() approach seems to be the modern approach as it supports nesting. More details here: http://mywiki.wooledge.org/BashFAQ/082