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
Changing old file name to new one if the old file name satisfied certain condition balzzz UNIX for Dummies Questions & Answers 1 02-17-2008 10:41 AM
Use awk to create new folder in current directory ccox85 Shell Programming and Scripting 6 01-28-2008 03:59 AM
print remaining file after a condition is satisfied hitmansilentass Shell Programming and Scripting 5 05-07-2007 11:35 AM
AIX - create folder in hdisk1 instead lwy2020 AIX 3 01-16-2007 04:56 AM
Create Folder in Multiple Directories Stud33 Shell Programming and Scripting 15 07-20-2006 04:44 PM

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 10-08-2007
maximas maximas is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 11
how to create folder wen the condition satisfied

hi

i hav files ha1j ha2m ha3n ha4q ha5s ...like tat im having some 20 files ..and i want to create a folder as the same amount of files which im having wen the condition if loop is satisfied ..

thank you
  #2 (permalink)  
Old 10-09-2007
timontt timontt is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 44
what is the if condition and the folders name?
  #3 (permalink)  
Old 10-09-2007
manas_ranjan's Avatar
manas_ranjan manas_ranjan is offline
Registered User
  
 

Join Date: Jul 2007
Location: Amsterdam
Posts: 177
can you explain your question in more details ?????
  #4 (permalink)  
Old 10-09-2007
maximas maximas is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 11
hi

my program is to sort the files and my files will be like tis

engPG1j1.top
engPG2h3.top
engPG3g5.top
engPG4r6.top
engPG5y1.top
engPG1u3.top
engPG2w8.top
engPG3e5.top
engPG4m3.top
etc...

And i have to create N folders at run time as many PG1 Files
say suppose im having 5 PG1 files ,then i have to create 5 folders and
each PG1 files should go into each folder again each PG2 files have to do the same
finally it will be (PG1,PG2,PG3,PG4,PG5)in one folder like tat i have to do

Thank you
  #5 (permalink)  
Old 10-09-2007
springs springs is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 4
i am assuming u hv some files like 20 after 20 files reading u want to create a folder ryt.

#!bin/ksh
count=` find $HOME /- maxdepth 1 - name "test_dat*.txt" - print | wc -l
if [ $count -gt 0 ]

then
for $txtfl in $HOME/test_dat*.txt;
do
echo "copy ur files in $txtfl"

cat $txtfl >> $HOME/dnew/dfile.dat
done;
print "moved sucessfully"
fi

i hope this will work ..
creates a new folder and file
  #6 (permalink)  
Old 10-09-2007
maximas maximas is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 11
thank you for ur great idea
its working man thank u a lot
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 04:51 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