The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 04-22-2009
mnmonu mnmonu is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 32
it's not working plz hlp

Quote:
Originally Posted by dennis.jacob View Post
Try this:

Code:
val="\"";
ls -ltr | awk -v var=$val  '{ORS=" ";print var $NF var; }'


Hi
When I tried this command on

[osbadmin@qa1 cp]$ ll
total 1272
-rw-rw-r-- 1 osbadmin osbadmin 0 Apr 22 14:38 a b
-rw-r--r-- 1 osbadmin osbadmin 427701 Apr 22 12:06 SANITY_TEST
-rw-r--r-- 1 osbadmin osbadmin 427701 Apr 22 12:06 Success 123333
-rw-r--r-- 1 osbadmin osbadmin 427701 Apr 22 12:06 Success 123333 (1)
[osbadmin@qa1 cp]$
it gives

[osbadmin@qa1 cp]$ val="\""; ls -ltr | awk -v var=$val '{ORS=" ";print var $NF var; }'
"1272" "(1)" "123333" "SANITY_TEST" "b" [osbadmin@qa1 cp]$

I have to get output as "a b" "SANITY_TEST" "Success 123333" "Success 123333 (1)"

Please help me.........