Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

In bash (and also shell which support brace expansionsupport brace expansion), you can do:

printf '%s\n' "$(printf 'mytext%s\n\n' {1..71})" | paste -sd', ' - >out

In POSIX shell:

printf '%s\n' "$(
n=1
while [ "$n" -le 71 ]; do
  printf 'mytext%s\n\n' "$n"
  n=$((n+1))
done
)" | paste -sd', ' - >out

In bash (and also shell which support brace expansion), you can do:

printf '%s\n' "$(printf 'mytext%s\n\n' {1..71})" | paste -sd', ' - >out

In POSIX shell:

printf '%s\n' "$(
n=1
while [ "$n" -le 71 ]; do
  printf 'mytext%s\n\n' "$n"
  n=$((n+1))
done
)" | paste -sd', ' - >out

In bash (and also shell which support brace expansion), you can do:

printf '%s\n' "$(printf 'mytext%s\n\n' {1..71})" | paste -sd', ' - >out

In POSIX shell:

printf '%s\n' "$(
n=1
while [ "$n" -le 71 ]; do
  printf 'mytext%s\n\n' "$n"
  n=$((n+1))
done
)" | paste -sd', ' - >out
added 12 characters in body
Source Link
cuonglm
  • 158.2k
  • 41
  • 342
  • 420

In bash (and also shell which support brace expansion), you can do:

printf '%s\n' "$(printf 'mytext%s\n\n' {1..71})" | paste -sd', ' - >out

In POSIX shell:

printf '%s\n' "$(
n=1
while [ "$n" -le 71 ]; do
  printf 'mytext%s\n\n' "$n"
  n=$((n+1))
done
)" | paste -sd', ' - >out

In bash (and also shell which support brace expansion), you can do:

printf '%s\n' "$(printf 'mytext%s\n\n' {1..71})" | paste -sd', ' -

In POSIX shell:

printf '%s\n' "$(
n=1
while [ "$n" -le 71 ]; do
  printf 'mytext%s\n\n' "$n"
  n=$((n+1))
done
)" | paste -sd', '

In bash (and also shell which support brace expansion), you can do:

printf '%s\n' "$(printf 'mytext%s\n\n' {1..71})" | paste -sd', ' - >out

In POSIX shell:

printf '%s\n' "$(
n=1
while [ "$n" -le 71 ]; do
  printf 'mytext%s\n\n' "$n"
  n=$((n+1))
done
)" | paste -sd', ' - >out
Source Link
cuonglm
  • 158.2k
  • 41
  • 342
  • 420

In bash (and also shell which support brace expansion), you can do:

printf '%s\n' "$(printf 'mytext%s\n\n' {1..71})" | paste -sd', ' -

In POSIX shell:

printf '%s\n' "$(
n=1
while [ "$n" -le 71 ]; do
  printf 'mytext%s\n\n' "$n"
  n=$((n+1))
done
)" | paste -sd', '