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
Insert a line including Variable & Carriage Return / sed command as Variable lowmaster Shell Programming and Scripting 2 05-20-2009 12:26 AM
Need a sed command that uses variable ketkeep Shell Programming and Scripting 2 06-07-2008 02:36 PM
Question On Command in Variable scotbuff Shell Programming and Scripting 4 10-29-2007 08:23 PM
set variable command ammu Shell Programming and Scripting 1 05-24-2007 10:45 AM
Export command giving Variable Name vs the Value set for the Variable ParNone UNIX for Dummies Questions & Answers 2 04-03-2006 12:43 PM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-14-2009
Sangtha Sangtha is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 18
Using variable in ls command

I am in /home/aaa path and trying to list all the files in different directory - the path to this directory is lengthy. For example: aa/bb/cc/dd/ee/ff/gg/hh/ii/jj... and also the path will change dynamically.

HEnce I capture the directory path in a variable. How to use this variable in ls command.

The variable is $dir_name

I currently have ls $dir_name out_* | wc -l

To list all files starting with "out_" from directory in variable "$dir_name".

This is not working. Please advise.

Thanks!
 

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 04:06 PM.


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