The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Listing a directory via a script using variables
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Listing a directory via a script using variables
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
10-10-2008
zaxxon
Moderator
Join Date: Sep 2007
Location: Germany
Posts: 2,313
I guess it can't find anything since you can't write a regular expression for grep like you use metacharacters in the shell. Try this:
Code:
file="TEST01_.*\.mqsc"
Your former code meant _* which stands for zero or <n> occurences of _. And just a dot means any single character, not a dot. So the dot has to be escaped.
Oh and maybe use "ls -1" to have 1 file per row.
zaxxon
View Public Profile
Find all posts by zaxxon
Find zaxxon's past nominations received
Find zaxxon's present nominations given