0

echo -n

my_function() {
  echo -n "$@"
}

my_function hello world

I get my desired output:

hello world

printf

my_function() {
  printf "$@"
}

my_function hello world

I get only the hello. Where is the world?:

hello


Thanks for your help :)

Bog
  • 989
  • The first argument to printf should be a format string, normally containing specifiers like %s to tell it what to do with the remaining argument(s) - since you haven't provided such, the remaining arguments are ignored and the format string is printed verbatim. – steeldriver Apr 20 '23 at 15:25
  • @steeldriver ahh bruh I feel so stupid, of course... How did I forget about that^^ Thanks :) – Bog Apr 20 '23 at 15:38

0 Answers0