LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-29-2010, 12:59 AM   #1
cedardoc
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:

Code:
#!/usr/bin/python
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:
Code:
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?

Thanks
 
Old 08-03-2010, 04:59 PM   #2
cedardoc
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?
 
  


Reply


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 10:16 AM
[SOLVED] Converting a Shell script to a Python script TheIndependentAquarius Programming 4 01-29-2010 01:27 AM
Running command in gnome-terminal from script results in "...error creating child..." PlancksCnst Linux - General 6 04-08-2009 01:09 PM
Script results keep coming out to Zero acidblue Linux - Newbie 2 04-06-2009 10:09 PM
python cgi script and premature end of script headers Neruocomp Programming 1 07-28-2005 12:43 PM


All times are GMT -5. The time now is 10:08 AM.

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