Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-25-2009, 11:20 PM
|
#1
|
Member
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 707
Rep:
|
strange output of regex
Hi all...
Code:
[vinay@TEG test]$ echo grapes>"text sample2"
[vinay@TEG test]$ cat "`ls text*le2`"
grapes
[vinay@TEG test]$ cat "`ls text*2`"
cat: text2
text sample2: No such file or directory
Here I feel 3rd command should display contents of file "text sample2"...The output is really looking strange...How is this working ?
|
|
|
11-25-2009, 11:27 PM
|
#2
|
Member
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 707
Original Poster
Rep:
|
Quote:
Originally Posted by vinaytp
Hi all...
Code:
[vinay@TEG test]$ echo grapes>"text sample2"
[vinay@TEG test]$ cat "`ls text*le2`"
grapes
[vinay@TEG test]$ cat "`ls text*2`"
cat: text2
text sample2: No such file or directory
Here I feel 3rd command should display contents of file "text sample2"...The output is really looking strange...How is this working ?
|
I got the concept.....
shell is giving the cat command a single parameter text2..
|
|
|
11-25-2009, 11:29 PM
|
#3
|
Member
Registered: Sep 2009
Location: Russia
Distribution: Gentoo, LFS
Posts: 399
Rep:
|
Code:
web31337@srvr:/tmp$ echo grapes>"text sample2"
web31337@srvr:/tmp$ cat "`ls text*le2`"
grapes
web31337@srvr:/tmp$ cat "`ls text*2`"
grapes
it works fine for me. works on debian lenny (2.6) and even on my freebsd vds.
i simply copypasted these commands from your code.
|
|
|
11-26-2009, 04:39 AM
|
#4
|
Member
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 707
Original Poster
Rep:
|
Quote:
Originally Posted by Web31337
Code:
web31337@srvr:/tmp$ echo grapes>"text sample2"
web31337@srvr:/tmp$ cat "`ls text*le2`"
grapes
web31337@srvr:/tmp$ cat "`ls text*2`"
grapes
it works fine for me. works on debian lenny (2.6) and even on my freebsd vds.
i simply copypasted these commands from your code.
|
Hi web31337...
Can you pls now execute those commands....
|
|
|
11-26-2009, 04:54 AM
|
#5
|
Member
Registered: Sep 2009
Location: Russia
Distribution: Gentoo, LFS
Posts: 399
Rep:
|
mhm i get it.
cat text*2 is what you need.
|
|
|
All times are GMT -5. The time now is 03:23 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|