How to use printf in bash

Hello, this is my first time on the forum. I seem to not have the ability to start a new thread. However, I have a very simple question. I am trying to write a script I have to use printf to say "My name is myname (pulled from $USER) . it works with echo, but with printf the $USER name is my longer. any suggestions.

------ Post updated at 12:14 PM ------

I am new to the forum. can't find a place to start new thread. I need help. Hve assignment in UNIX. beginning! Need to use printf to say "My name is ......." I have to pull my name from $USER. When I do that with echo it works. with printf it lists a long string. how can I shorten $USER to just my name with printf.

Please note that we have a special forum form homework/coursework questions. We can transfer the thread there if this is homework or classwork. Also note that special rules apply in these part of the forum (see the description there for details).

To your problem: you say that it "works with echo". Have you considered providing a format string for printf? I suggest executing the command man printf and read that.

I hope this helps.

bakunin

.....