How to get a value from a file and serach that value filename in a dir?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to get a value from a file and serach that value filename in a dir?
# 8  
Old 06-07-2017
Above script doesn't even run but errors out. If the syntax error has been corrected, there still remains a logical flaw (actually it occurs twice). Those corrected, it processes all three entries in your test file.
# 9  
Old 06-08-2017
Thanks Rudic, as i informed in the other thread it is working for me now.

its worked for me.... both "for" and "while" worked for me, its my bad early i used it wrong.

Thanks guys for helping me!!!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print filename/dir name while executing aclput using find command

Running below command , but unable to print the filename , is there way to print filename/dirname using -print option find . -type f -exec aclput -i fileacl.template {} \; (5 Replies)
Discussion started by: lalitpct
5 Replies

2. Windows & DOS: Issues & Discussions

Check dir for overly path+filename and list in txt

Well since Windows always laments over some of my files having a too long "path+filename" and it gets in the way of copying complete directory structures I would love to have a DOS Script that helps me with finding those. I already tried DCSoft Long Filename Finder but that is neither DOS based... (3 Replies)
Discussion started by: pasc
3 Replies

3. Shell Programming and Scripting

serach diff filename in diff location using shell scripting

Hi, I am new to shell scripting. please help me to find out the solution. I need a script where we need to read the text file(consists of all file names) and get the file names one by one and append the date suffix for each file name as 'yyyymmdd' . Then search each file if exists... (1 Reply)
Discussion started by: Lucky123
1 Replies

4. UNIX for Dummies Questions & Answers

How to list all files in dir and sub-dir's recursively along with file size?

I am very new to unix as well as shell scripting. I have to write a script for the following requirement. In have to list all the files in directory and its sub directories along with file path and size of the file Please help me in this regard and many thanks in advance. (3 Replies)
Discussion started by: nmakkena
3 Replies

5. Shell Programming and Scripting

want to move files in a dir into different directories based on the filename

I want to move the files in a dir to different dirs based on their file names. Ex: i have 4 different files with name - CTS_NONE_10476031_MRL_PFT20081215a.txt CTS_NONE_10633009_MRL_PFT20091020a.txt CTS_NONE_10345673_MRL_PFT20081215a.txt CTS_NONE_10872456_MRL_PFT20091020a.txt and the 1st... (4 Replies)
Discussion started by: Sriranga
4 Replies

6. UNIX for Dummies Questions & Answers

want to move files in a dir into different directories based on the filename

I want to move the files in a dir to different dirs based on their file names. Ex: i have 4 different files with name - CTS_NONE_10476031_MRL_PFT20081215a.txt CTS_NONE_10633009_MRL_PFT20091020a.txt CTS_NONE_10345673_MRL_PFT20081215a.txt CTS_NONE_10872456_MRL_PFT20091020a.txt and the 1st... (2 Replies)
Discussion started by: Sriranga
2 Replies

7. UNIX for Dummies Questions & Answers

How to get dir name tacked onto filename with ls command

hello i'm trying to figure out how to tack the directory name onto the file name when i do the ls -ltrR command please? --------------------------------------------------------------------------------- I do the following command ls -ltrR > ls.out and get the following output:... (5 Replies)
Discussion started by: bobk544
5 Replies

8. Shell Programming and Scripting

serach file using awk

Hi, I was able to print lines when search for specific string using awk but i want to print when search for two different strings using awk instead of doing two times (Print lines only contain "Insert Records and Insert into" not between lines) Ex: awk '/Insert Records./' a4.log It... (3 Replies)
Discussion started by: mohan705
3 Replies

9. Shell Programming and Scripting

Print filename and resolution in wrkng dir

Greetings, I am trying to write script, (preferably in sh) that will use a proprietary program to print the resolution and name of files in the current working directory in a vertical format. I think this script will require 3 commands with variables and a pipe to the prop program, but am not... (6 Replies)
Discussion started by: rocinante
6 Replies

10. UNIX for Advanced & Expert Users

text serach in unknown file

Can any one tell me if there is an easy way to find a text in an unknown file name in a dierectory. I'm trying to search for the text "where is john going" from a file whose name I do not even know. There are about 1000 files in that directory and one of the files has this text in it. Can... (11 Replies)
Discussion started by: ted
11 Replies
Login or Register to Ask a Question