The UNIX and Linux Forums  


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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
SED command ---------help needed veerapureddy Shell Programming and Scripting 4 03-17-2008 05:12 PM
help needed in fuser command anju Shell Programming and Scripting 1 02-20-2008 02:08 AM
Help needed on Date command nikunj Shell Programming and Scripting 5 07-08-2006 12:37 PM
Help needed for ps command in AIX moe2266 AIX 0 09-30-2005 12:43 PM
help needed for sed command manualvin UNIX for Dummies Questions & Answers 2 06-25-2004 12:41 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-18-2008
anju anju is offline
Registered User
  
 

Join Date: Jan 2008
Location: Bangalore
Posts: 17
Unhappy help needed in ls command

Hi all,

i need to write an ls command which will pick up
ind_01.txt/pak_01.txt from

ind_01.txt
pak_01.txt
usa_01.txt

files in a directory..

i wrote a ls command by storing ind and pak in 2 variables and listing it. Its working fine. But the pattern to be matched should be sent in command line argument and so it should be a single variable.

i want a regular expression which will store ind/pak_01.txt. so that i can sent it in command line argument

please help..

Thanks In Advance.

Anju

Last edited by anju; 02-18-2008 at 04:23 AM..
  #2 (permalink)  
Old 02-18-2008
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,934
This will match ind.txt and pak.txt but will also match other combinations of these letters.
If you only have these two files in your directory, it will work for you.

Code:
 ls [ip][na][dk].txt
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:31 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0