searching files and display if present


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers searching files and display if present
# 1  
Old 07-28-2010
searching files and display if present

Write a unix program to which files names will be passed as single
parameter (i.e all the file names will be concatenated
by using a specific symbol) and it will search in the respective
directories if the file exists there or not. For example
suppose the following parameter is passed "file1.txt:file2.txt:file3.zip"
to the program then it will search the files
file1.txt and file2.txt in the txt folder and file3.zip in the zip folder
and display that if they are present there or not.
# 2  
Old 07-28-2010
Homework? Recruitment test?
# 3  
Old 07-28-2010
Quote:
Originally Posted by pludi
Homework? Recruitment test?


Please reply ...I am new to unix and it's being frequently asked?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unzip all the files with subdirectories present and append a part of string from the main .zip files

Hi frnds, My requirement is I have a zip file with name say eg: test_ABC_UH_ccde2a_awdeaea_20150422.zip within that there are subdirectories on each directory we again have .zip files and in that we have files like mama20150422.gz and so on. Iam in need of a bash script so that it unzips... (0 Replies)
Discussion started by: Ravi Kishore
0 Replies

2. Shell Programming and Scripting

To Tar files which are not present

Hi guys, I need how its possible to tar group of files even though the respective file is not present for eg in my home folder my script looks like below by reading the content from file.txt and creating tar out of it can any one help on the below query a=`more file.txt` tar -cvf... (6 Replies)
Discussion started by: rohit_shinez
6 Replies

3. Shell Programming and Scripting

Joining files present in different directories.

Hi Experts, I have files Bank1 ,Bank2 ,Bank3 with high level customer information in one folder. /home/Cust_information/ Bank1,Bank2,Bank3,Bank4 The detail level information of all customers of each Bank are present in separate directories . Here Bank1 is a directory which contains set... (2 Replies)
Discussion started by: bharathbangalor
2 Replies

4. Shell Programming and Scripting

Checking in a directory how many files are present and basing on that merge all the files

Hi, My requirement is,there is a directory location like: :camp/current/ In this location there can be different flat files that are generated in a single day with same header and the data will be different, differentiated by timestamp, so i need to verify how many files are generated... (10 Replies)
Discussion started by: srikanth_sagi
10 Replies

5. Shell Programming and Scripting

List all the files in the present path and Folders and subfolders files also

Hi, I need a script/command to list out all the files in current path and also the files in folder and subfolders. Ex: My files are like below $ ls -lrt total 8 -rw-r--r-- 1 abc users 419 May 25 10:27 abcd.xml drwxr-xr-x 3 abc users 4096 May 25 10:28 TEST $ Under TEST, there are... (2 Replies)
Discussion started by: divya bandipotu
2 Replies

6. Shell Programming and Scripting

How to display the line number of file while searching for a pattern

awk 'BEGIN{IGNORECASE=1} /error|warning|exception/ { ++x } END { print x }' filename The above command returning the number of times the pattern present in the file. But I want the the line number as well. please help me out (6 Replies)
Discussion started by: arukuku
6 Replies

7. UNIX for Advanced & Expert Users

query display number lines or records present in file only numeric value -without filename

Hi all Thanks in advance........... Please help me for this issue............ I have a file it has 11 records . I used the command like .... >$ wc -l file 11 file I'm getting output like 11 file (no.of records along with filename) here my requirement is, I want to display only... (3 Replies)
Discussion started by: ksrivani
3 Replies

8. UNIX for Dummies Questions & Answers

Awk help needed for display particular field alone for searching pattern

Hi, I have a requirement for taking an particular number in a log file. if i grep for the particular string it will retrieve the entire line for the particular string. but i want to display only the string from each line which i am searching for, Note: The searching field varies its position... (3 Replies)
Discussion started by: senthilkumar_ak
3 Replies

9. Shell Programming and Scripting

check whether 3 files are present

I'm trying to check whether 3 files are existing and send 3 files as attachements. If only two are there then send those two files as attachments. if ; then elif ; then I tired the above given syntax and then it is giving me an error line 11: ' I tried with -a instead of && and... (3 Replies)
Discussion started by: Celvin VK
3 Replies

10. Shell Programming and Scripting

PERL: print if files present

FOR: Windows NT 4 I want perl to read a directory. there is suposed to be two files in the folder ( file1.ini and file2.ini ) and i want perl to print "Files present" or "Files NOT present" to a text document ( report.txt ) how do i do it.? (2 Replies)
Discussion started by: perleo
2 Replies
Login or Register to Ask a Question