can any body help me out on this...


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers can any body help me out on this...
# 1  
Old 07-15-2008
can any body help me out on this...

Hi friends..
I am using the below command to search few files from many folders which is under one folder..

i mean let say the path is A/B/C...and inside C...i have 1-10 folder...

the below command is working fine....

for i in 1 3 5 7; do
find /A/B/C/${i} -name "*.txt" -o -name "*.csv" -o -name "*.TXT" -o -name "*.dat" |xargs ls -ltr |awk '{print $8 ,$9}' >> ${i}.txt
done

this will give me the result from the folder 1 3 5 7 ,from 1-10 which is inside A/B/C[/b] and print the file having the above extension into 1.txt , 3.txt , 5.txt , 7.txt etc inside /A/B/C

Help needed..

i need some help so that my syntax will search the file only from folder 1,3,5,7 from the 10 folder A/B/C and the out put from these 4 folder will be display in the single file i.e result.txt....not in different folder.

the above 1,3,5,7 folders are inside A/B/C
# 2  
Old 07-15-2008
I have a great feeling of "deja vu" its maybe time for me to have supper and go to bed...

https://www.unix.com/shell-programmin...#post302214206
https://www.unix.com/shell-programmin...-solution.html

Did you know there were rules out there e.g:

(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post or send a private message where your goal is to get an answer more quickly.
# 3  
Old 07-15-2008
Quote:
Originally Posted by vbe
I have a great feeling of "deja vu" its maybe time for me to have supper and go to bed...

https://www.unix.com/shell-programmin...#post302214206
https://www.unix.com/shell-programmin...-solution.html

Did you know there were rules out there e.g:

(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post or send a private message where your goal is to get an answer more quickly.
Thread closed.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[Solved] Cant get message body

Hi guys . I am trying to take the output of top command and mail it to myself . The code is : echo ############################################################## /usr/local/bin/top c n 1 b >> /export/home/top-output.txt echo ############################################################## ... (6 Replies)
Discussion started by: Junaid Subhani
6 Replies

2. Shell Programming and Scripting

Multiple if body how?

Hi All, I'm a newbie here, I'm just wondering how can i print my two code in if statement? awk -F "," '{ if ($10 ="YES") print $1",",$2",",$4",",$5",",$6;}' $line > $line.dat -->this is working print $2",",$4}' $line > niks.txt --> i encountered error on... (3 Replies)
Discussion started by: nikki1200
3 Replies

3. Shell Programming and Scripting

Mail with body

Hello All, I wish to mail after completion of code. I would like to include subject and body in it. I am not looking to read the body from other file but willing to provide the body in the command itself. Can i do this way? I am looking to pass some parameters to body and this will be possible... (1 Reply)
Discussion started by: forums123456
1 Replies

4. Shell Programming and Scripting

The body of the Email -- mailx

Hi, I am using mailx command to send an email and i took the body of the email from a file, mailx -r gtt.org -s "Status Report " ss@org.com < $ProcessStatisticsFile but now i want to declare the body of the email in the command itself. I have tried with the following command but... (4 Replies)
Discussion started by: chinnu01
4 Replies

5. Shell Programming and Scripting

Any body suggest me.........!!!!

i am jaswanth, i am very new to unix/linux, upto now i worked in windows only., but i took coatching for unix.., and my sir teached all my classes in red hat linux and told me that all are same...!!! I know shall programming in red hat linux.., but now i installed opensloaris but the... (5 Replies)
Discussion started by: strgraphics
5 Replies

6. Shell Programming and Scripting

How to mail with this body

Hi, i have a file ABC, i want to mail the contents of this file and i want to make the body of the mail per my choice like this: Hi All, This is the Report for today. <Browse of the File ABC> i am using : mailx -s "Today's Report" abcd@xyz.com << EOT Hi All, This is... (1 Reply)
Discussion started by: Prat007
1 Replies

7. Shell Programming and Scripting

how to check body of the email

Dears, i have user called dellsh i hope to make this script when this user recieve email check the budy of the email about (StatusRequest) when i find this email contain this subject run crontab do this job (create file in my home directory called index) thanks for your attention (1 Reply)
Discussion started by: dellsh
1 Replies

8. Shell Programming and Scripting

Can any body give me a solution to this...

Hi friends.. I am using the below command to search few files from many folders which is under one folder.. i mean let say the path is A/B/C...and inside C...i have 1-10 folder... the below command is working fine.... for i in 1 3 5 7; do find /A/B/C/${i} -name "*.txt" -o -name "*.csv"... (9 Replies)
Discussion started by: sapan123
9 Replies

9. Linux

Can any body tell me.

:(I want to install linux (SLES-9-SP4-CD-x86_64-GM-CD1) but it doesnot work. It said the computer is 32 bits you cannot use 64 bits on it. (3 Replies)
Discussion started by: sackNumchai
3 Replies

10. Shell Programming and Scripting

need some help...can any body give some idea

Hi i need some help... 1.i have one main folder XYZ. 2.Many folders inside xyz say abc,def,mno 3.And inside each folder, i have many files . want to print what ever files are present inside the subfolder abc,def,mno (what ever todays file ) in output file.out put file should be in xyz(say... (13 Replies)
Discussion started by: sapan123
13 Replies
Login or Register to Ask a Question