![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Reading an Input file and searching for occurrences WIHOUT SED or AWK | kartikkumar84@g | Shell Programming and Scripting | 2 | 05-08-2008 09:16 PM |
| Searching filenames containing certain text??? | skyineyes | UNIX for Advanced & Expert Users | 6 | 01-16-2008 07:48 AM |
| reading and searching xml element text in script | forevercalz | Shell Programming and Scripting | 6 | 11-10-2005 11:35 PM |
| Help with searching a text file | thekid2 | Shell Programming and Scripting | 6 | 01-02-2004 02:09 AM |
| Reading from files and searching them | Prometheus20 | Shell Programming and Scripting | 1 | 05-02-2002 01:52 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
well i have this xml file here: this file is called filereader.xml
<?xml version="1.0" encoding="UTF-8"?> <file> <file1> <filecopy>/new/test/thefile.txt</filecopy> <filecopy>/new/test/thefile2.ppt</filecopy> </file1> </file> i need to write the script that search for the Bold text inside the xml without using java. The underlined part is the directory... so the script will first look into the tag--filecopy..then look into a basedirectory which i created called checkdirectory after that it will look into /new/test/ in the tag which is also a directory to locate the file. Eg. thefile.txt is in checkdir/new/test/thefile.txt and thefile2 is in checkdir/new/thefile2.txt i have a code here....but it will only capture file in the tag...it will not look into /new/test folder...can someone help me out? the coding i have is : #!/bin/sh sed -e '/filecopy/ !d' -e 's!<filecopy>\([^<]*\)</filecopy>!\1!' filereader.xml | while read file; do if [ -f "../checkdir/${file}" ]; then echo "File exists : ${file}" else echo "File not exist : $${file}" fi done exit 0 Last edited by forevercalz; 11-24-2005 at 09:37 PM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|