Hi All,
I got a script like
#!/bin/ksh
echo "Welcome Sir"|awk '
{
print $1
}'
This is printing Welcome. I want output like 'Welcome' enclosing by single quotes.
Please assist me.
Thanks,
Shahnaz.
Hi All,
I got a script like
#!/bin/ksh
echo "Welcome Sir"|awk '
{
print $1
}'
This is printing Welcome. I want output like 'Welcome' enclosing by single quotes.
Please assist me.
Thanks,
Shahnaz.
This little script may do the trick:
#!/bin/bash
hi=`echo "welcome sir" | awk '{print $1}'`; echo "'"$hi"'"
Probably this would work:--
#!/bin/ksh
echo "Welcome Sir"|awk '{print \'$1\'}'
Thanks all for your valuable solutions.
I tried the following it worked for me.
#!/bin/ksh
# ' means interpretter on in awk terminology
echo "welcome to my home"|awk '
{
print "'\''"$1"'\''"
}'
' is interpretter on/off in awk terminology...
Thanks,
Shahnaz.
HI,
This is my first reply unix forum,
please try this,
echo "'welcome' sir" | awk '{print $1}'
o/p is 'welcome'