How to echo text and parameter to user on one line
Posted on 2007-04-05
I'm an Oracle PL/SQL Developer/Consultant. As a consultant I've also been tasked with writing UNIX scripts, even though the client can't give me access to the UNIX box because their security folks won't allow it. Therefore, I can't "play around" like I'd want to...to figure this out.
I'm trying to echo back to the user, who wil be at the UNIX prompt, when they run the script a text message along with a parameter.
In PL/SQL I'd write it like this:
prompt 'The following parameter, '||p_Name||' has not been defined.'
dbms_output.put_line('The following parameter, '||p_Name||' has not been defined.');
In UNIX (korn shell script) I've written it this way - and I realize that the pipes cannot be used for concatenation, which is why I'm asking this question:
echo "The following parameter, $NAME has not been defined"
Is the above correct or will it literally use $NAME instead of value of $NAME? If it's not correct please let me know how I should procede to get the desired result OR please let me know if I'm on the right track.