The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
concat const char * with char * nicos High Level Programming 4 02-18-2009 01:01 PM
Consoles gone wild! josephgreensr SUN Solaris 5 02-10-2009 02:08 PM
Adding a single char to a char pointer. pallak7 High Level Programming 5 12-06-2008 11:46 PM
How to replace any char with newline char. mightysam Shell Programming and Scripting 5 09-18-2008 09:15 PM
df, grep, wild card itik AIX 2 01-24-2008 10: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 05-06-2009
nidhink nidhink is offline
Registered User
  
 

Join Date: May 2009
Posts: 2
wild char * in if

if [ -s filename.* ]; then => is it correct?

i need to check 10 files size and do the same action. The file name is same but extension of the files are different. how do i deal with it? Please help
  #2 (permalink)  
Old 05-06-2009
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,947
Won't work, use a for loop instead, eg.
Code:
for file in filename.*
do
    if [ -s ${file} ]
    then
        ...
    fi
done

Closed Thread

Bookmarks

Tags
unix commands, wild character

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 02:53 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