Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-28-2010, 11:59 PM   #1
LQ Newbie
Registered: Jul 2010
Distribution: Ubuntu 10.04
Posts: 5

Rep: Reputation: 0
mysterious discrepancy b/w script results at terminal and in python script

I have this script I'm trying to get working:

import os
code = os.system("egrep --exclude=searchresults.txt --exclude=*.{html,py*} '(word1.*word2)|(word2.*word1)' * > '/home/david/folder/searchresults.txt'")
when I copy this portion:
egrep --exclude=searchresults.txt --exclude=*.{html,py*} '(word1.*word2)|(word2.*word1)' *
and paste it into the terminal at the proper directory, it lists out the results properly, but when I run the whole python script (or paste the entire thing into the terminal) I get extra results in the "searchresults.txt" file from html and py files in the directory as if the second "--exclude" was not working.

Can anyone tell me what's going on here?

Old 08-03-2010, 03:59 PM   #2
LQ Newbie
Registered: Jul 2010
Distribution: Ubuntu 10.04
Posts: 5

Original Poster
Rep: Reputation: 0
is there something about sending results to a file that would affect the prior "exclude" commands?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to make a bash script keep running in same terminal after it calls second script? JohnRock Linux - Newbie 4 06-25-2010 09:16 AM
[SOLVED] Converting a Shell script to a Python script Aquarius_Girl Programming 4 01-29-2010 12:27 AM
Running command in gnome-terminal from script results in "...error creating child..." PlancksCnst Linux - General 6 04-08-2009 12:09 PM
Script results keep coming out to Zero acidblue Linux - Newbie 2 04-06-2009 09:09 PM
python cgi script and premature end of script headers Neruocomp Programming 1 07-28-2005 11:43 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:08 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration