Pular para o conteúdo

Saida horizontal no terminal [RESOLVIDO]

Responder tópico
  • Denunciar
  • Indicar

1. Saida horizontal no terminal [RESOLVIDO]

Enviado em 11/04/2020 - 18:17h

Ola
Como alterar o IFS para que seja impresso no terminal saída horizontal, ao invés de uma por linha?

Exemplo:

#!/bin/bash
CONTADOR=0

while [[ $CONTADOR -lt 5 ]]
do
echo "$CONTADOR"
let CONTADOR++
done

Saída:
0
1
2
3
4

Queria a saída: 0 1 2 3 4

Como procede?

;
Cesar


Responder tópico

2. Re: Saida horizontal no terminal

Melhor resposta

Enviado em 11/04/2020 - 19:27h


echo -n echo "$CONTADOR "
Veja o espaço antes de fechar os parenteses, sem ele vai printar tudo junto.

Responder tópico

Responder tópico

Entre na sua conta para responder.

Fazer login para responder