04-23-2007
Pattern expansion problem
All,
I have a shell script which executes the below command
find $1 -name $2 -print > ${Backup}/FileFind.txt
I have $2 sometimes coming with the below values.
.[a-z]*
When I go to the log after the execution of the script, .[a-z]* gets expanded to .developer.adm instead of searching for all the . files like .profile, .odbc etc. How do I comeover this issue?
Your help will be greatly appreciated.
Thanks.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file with the following contents;
NEW 85174 MP081 /29OCT07
CNL 85986 MP098 /28OCT07
NEW 86014 MP098 /28OCT07
NEW 86051 MP097 /27OCT07
CNL 86084 MP097 /27OCT07
Now I have to retrieve all lines that start with NEW and where the next line starts with CNL and where the MP codes are... (8 Replies)
Discussion started by: rein
8 Replies
2. Shell Programming and Scripting
FilesToBackup='*.track* *.xml *.vm* *.gz Trace* TRACE* "*core*" *.out fcif_data_* esi_error_* *.rollback *.sed R.* APStatus_*
log* *.output* send_mail* downenv* check_env* intaspurge_db_* sqlnet.log *.rpt *.html *.csv "*TSC*"'
and i am using it like this-
echo Moving files from $(pwd):
... (2 Replies)
Discussion started by: namishtiwari
2 Replies
3. Shell Programming and Scripting
Can anyone help me in a scriptfor below example which has to find the string "System && Passcode 0" or "System && Failcode ??"
If this searched string occurs consecutively 4 times it should provide output as error
S.No : Program: Status
1. was : Passcode 1
2. System: Passcode 0... (1 Reply)
Discussion started by: gantagoru
1 Replies
4. Shell Programming and Scripting
I have a script that takes an option for server pools to run the script against. The option is given as a comma separated list (ie, -p 201,204,301).
I'm using eval and brace expansion to get those pool numbers into an array. It works fine unless only 1 pool number is given. Here's the code:
... (5 Replies)
Discussion started by: mglenney
5 Replies
5. Shell Programming and Scripting
Hi ,
could anyone help me out with this problem.
sample.txt has this content :
u001- this is used for project1 ||
u002- this is used for p2|| not to be printed
u003- this is used
for project3 ||
u004- this is
used for p4 ||
u005- this is used for project5 ||
u006- this is used for p6... (9 Replies)
Discussion started by: Balaji PK
9 Replies
6. Shell Programming and Scripting
I have to create some fixed width files using UNIX. The data source is an Oracle SQL query. If I use straight SQL and spool to a file everything comes out as expected.
Example Desired result (. indicate blank space):
V278814831..................................1743049591.10N... (6 Replies)
Discussion started by: dortoh
6 Replies
7. Shell Programming and Scripting
# cat email.txt | grep -i "To:"
To: <test@example.com>
# cat email.txt | grep -i "Subject"
Subject: Test
Subject: How are you.
I need to print only test@example.com from To field need to eliminate "< & >" from To field and need to print entire subject after Subject:
It should be
#... (7 Replies)
Discussion started by: mirfan
7 Replies
8. Shell Programming and Scripting
Hi I need a bash script that can search through a text file for all lines starting with 71502FSC1206 on every line it finds starting with this I need to place a letter F at the 127 position on that line.
Thanks
Paul (6 Replies)
Discussion started by: firefox2k2
6 Replies
9. Shell Programming and Scripting
if i have to do pattern match for file name with digit alphanumeric value like this
File_1234.csv
File_12sd45rg.csv
i am using this File_*.csv
and File_*.csv for digit pattern match.
when i am doing pattern match for the digit then both alphanumeric match
and digit match is coming.
... (3 Replies)
Discussion started by: ramsavi
3 Replies
10. Shell Programming and Scripting
Hello All,
Could you please do help me here as I would like to perform parameter expansion in shell over a parameter expansion.
Let's say I have following variable.
path="/var/talend/nat/cdc"
Now to get only nat I could do following.
path1="${path%/*}"
path1="${path1##*/}"
Here... (8 Replies)
Discussion started by: RavinderSingh13
8 Replies