Sponsored Content
Top Forums Shell Programming and Scripting find string from multiple dir and redirect to new files Post 302409388 by clx on Thursday 1st of April 2010 02:24:56 AM
Old 04-01-2010
I am still confused.
your files are "jack<year>.txt" or with year extension eg jack.<year> ?
you wrote both the things.
Better give an example with the sample file names.

as per my understanding:
Code:
for file in $(find /path/to/parent/dir/of/A,B,C/ -type f -name "*.txt")
do
 grep 'Jack' $file > $HOME/$(basename $file).result
done

you can change the result file name whatever you want.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find and replace a string in multiple files

I used the following script cd pathname for y in `ls *`; do sed "s/ABCD/DCBA/g" $y > temp; mv temp $y; done and it worked fine for finding and replacing strings with names etc. in all files of the given path. I'm trying to replace a string which consists of path (location of file) ... (2 Replies)
Discussion started by: pharos467
2 Replies

2. Shell Programming and Scripting

shell script to find and replace string in multiple files

I used the following script cd pathname for y in `ls *`; do sed "s/ABCD/DCBA/g" $y > temp; mv temp $y; done and it worked fine for finding and replacing strings with names etc. in all files of the given path. I'm trying to replace a string which consists of path (location of file) ... (11 Replies)
Discussion started by: pharos467
11 Replies

3. Shell Programming and Scripting

How to Pull out multiple files from DB table and redirect all those files to a differetn directory?

Hi everyone!! I have a database table, which has file_name as one of its fields. Example: File_ID File_Name Directory Size 0001 UNO_1232 /apps/opt 234 0002 UNO_1234 /apps/opt 788 0003 UNO_1235 /apps/opt 897 0004 UNO_1236 /apps/opt 568 I have to... (3 Replies)
Discussion started by: ss3944
3 Replies

4. Shell Programming and Scripting

replace string in multiple files, dir and subdir

Hello, I have a directory www with multiple directories. Every directory has site name with .htm, .html, .php files or sub directories with .htm, .php, .html file as example - www - sitename 1 - site 1 - sitename 2 - sitename 3 What I'm looking for is a... (7 Replies)
Discussion started by: andyjill
7 Replies

5. Shell Programming and Scripting

A script to find dir, delete files in, and then del dir?

Hello!! I have directories from 2008, with files in them. I want to create a script that will find the directoried from 2008 (example directory: drwxr-xr-x 2 isplan users 1024 Nov 21 2008 FILES_112108), delete the files within those directories and then delete the directories... (3 Replies)
Discussion started by: bigben1220
3 Replies

6. Shell Programming and Scripting

How to find particular string in multiple files with in the current directory.

Hello friends, Plz suggest the find command, How to search a string in a paticular string in miltiple files with current dirctory.:) Thanks in advance. Siva Ranganath Ch (2 Replies)
Discussion started by: sivaranga001
2 Replies

7. Shell Programming and Scripting

How to find particular string in multiple files

Hello friends, I have find a paticular string from the files present in my user for example: a username and password is hardcoded in multiple files which present in the my user.so I have to search about username in which files it is available.there are several dirctories are there,so... (5 Replies)
Discussion started by: sivaranga001
5 Replies

8. Shell Programming and Scripting

KSH - Find paths of multiple files in CC (dir and sub-dir))

Dear Members, I have a list of xml files like abc.xml.table prq.xml.table ... .. . in a txt file. Now I have to search the file(s) in all directories and sub-directories and print the full path of file in a output txt file. Please help me with the script or command to do so. ... (11 Replies)
Discussion started by: Yoodit
11 Replies

9. Shell Programming and Scripting

Script to find & replace a multiple lines string across multiple php files and subdirectories

Hey guys. I know pratically 0 about Linux, so could anyone please give me instructions on how to accomplish this ? The distro is RedHat 4.1.2 and i need to find and replace a multiple lines string in several php files across subdirectories. So lets say im at root/dir1/dir2/ , when i execute... (12 Replies)
Discussion started by: spfc_dmt
12 Replies

10. Shell Programming and Scripting

Find a string and then return the next 20 characters in multiple files

Hello all, I have a directory with 2000+ files. I need to look in each file for an invoice number. To identify this, i can search for the string 'BIG' and then retrieve the next 30 characters. I was thinking awk for this, but not sure how to do it. Each file contains one long string and in... (8 Replies)
Discussion started by: jdinero
8 Replies
JACK-STDOUT(1)						      General Commands Manual						    JACK-STDOUT(1)

NAME
jack-stdout - write JACK audio data to stdout SYNOPSIS
jack-stdout [OPTIONS] port1 [ port2 ...] DESCRIPTION
jack-stdout captures audio from JACK and writes raw data to standard-output. The number of given ports detemine the number of audio channels that are used. If more than one channel is given, the audio-sample data will be interleaved. OPTIONS
-b, --bitdepth BITS Specify the bit-depth of each sample. For integer-encoding this can be 16 or 24. The default is 16. This setting is only used for integer encoding: Floating-point samples will always be 32 bit wide. -d, --duration SEC Specify the time for which jack-stdout should run in seconds. A value less than 1 means to run indefinitely. The default is 0. -e, --encoding FORMAT Set the output format of the data: signed-integer, unsigned-integer, floating-point (default: signed) -h, --help Print a brief usage information -L, --little-endian Write little-endian data or native-byte-order float (this is the default) -B, --big-endian Output big-endian data or swap the byte-order of floating-point -q, --quiet Inhibit usual output. This affects information and buffer-overflow warnings but not setup-errors. -S, --bufsize SAMPLES Choose the internal buffer-size in samples. The default size is 65536. The given value will be multiplied by the number of channels and bit-depth to get the size of the ring-buffer. EXAMPLES
jack-stdout xmms_0:out_1 xmms_0:out_2 | mono ~/Desktop/Downloads/JustePort.exe - 10.0.1.6 0 jack-stdout -b 24 -e unsigned -B system:capture_1 system:capture_2 | sox -t raw -r 48k -e unsigned -b 24 -B -c 2 - /tmp/recording.wav jack-stdout system:capture_1 system:capture_2 | oggenc -r -R 48000 -B 16 -C 2 - > /tmp/recording.ogg jack-stdout system:capture_1 | oggenc -r -R 48000 -B 16 -C 1 - | oggfwd -p -n "my live stream" localhost 5900 hackme live.ogg AUTHOR
Robin Gareus <robin@gareus.org>. SEE ALSO
http://jackaudio.org/, 29 March 2011 JACK-STDOUT(1)
All times are GMT -4. The time now is 03:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy