Solved

Problem with interactive bash shell versus scripted

Posted on 2006-06-20
1
193 Views
Last Modified: 2010-04-22
Hi I've encountered the following problem. , Oh i'm using cygwin.
The folllow command

$ find . -name 'BuildLog.htm' -printf "'%P'\n\r"

and it works exactally as I expect. It finds all BuildLog.htm files from the current directory and below. Then prints out each file path\name as a quoted string.

However whin I try and script it the script runs witout errors but finds nothing

#!/bin/sh

LOG_FILE=\''BuildLog.htm'\'
Pattern=\"\'%P\'\\n\\r\"
echo find . -name $LOG_FILE -printf $Pattern
find . -name $LOG_FILE -printf $Pattern
0
Comment
Question by:MichaelAllen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 15

Accepted Solution

by:
bpmurray earned 500 total points
ID: 16941677
Don't know why you have all those escapes, but this works fine:

LOG_FILE="*.tmp"
Pattern="%P'\\n\\r"

find . -name "$LOG_FILE" -printf "$Pattern"

And, of course, it gives the same result as:

find . -name "$LOG_FILE" -print
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question