file redirect within back ticks not working

K

ktom

from with a perl script this line does not work

`sed -e 1,14d $file >> /tmp/junk`;

it seems the redirect does not work.
 
T

Tad McClellan

ktom said:
from with a perl script this line does not work ^^^^^^^^^^^^^
`sed -e 1,14d $file >> /tmp/junk`;

it seems the redirect does not work.
^^^^^^^^^^^^^

What did you expect it to do?

What did it do instead?
 
K

ktom

Tad said:
^^^^^^^^^^^^^

What did you expect it to do?

What did it do instead?


the /tmp/junk file is empty...

i print the $file prior to this command and it has the proper value.

copy the sed line to the command line, replace $file with proper file
name it works.

this seem too silly

using the same line within the system function, all data goes to the
screen instead of the file..

putting the xmgrace line within the system function does not change the
results.

see below the actual snippet


`touch /tmp/psFile.out`;

print "Working on..\n";
foreach my $file ( @fileList ) {
print "\t$file\n";
`xmgrace -nosafe $file`;
( $psFile = $file ) =~ s/xgr/ps/ ;
print "$psFile\n";
# system( "sed -e 1,14d $psFile >> /tmp/psFile.out");
`sed -e 1,14d $psFile >> /tmp/psFile.out`;
 
R

Randal L. Schwartz

ktom> from with a perl script this line does not work
ktom> `sed -e 1,14d $file >> /tmp/junk`;

ktom> it seems the redirect does not work.

I'm not going to answer any question where the poster is forging
addresses of both "nowhere.com" and "billgates.com", thus
polluting those domains for more spam and making replies difficult.

PLEASE PEOPLE.

If you don't want replies, and don't want spam, DON'T USE A VALID
DOMAIN NAME.

You're being very unfair to people who own that domain name, either
now or in the future.

Use "example.com" or "anything.you.want.as.long.as.it.ends.with.invalid"

Those are specifically set aside as "non-domains".

I say this having been burned with stonehenge.com on more than one
occasion. There are now half a dozen addresses at stonehenge.com that
are completely useless because they've been introduced to the
spammers.

You don't get to take a valid domain for your own. In the US, this
can be prosecuted as fraud. Be careful.
 
K

ktom

Randal said:
ktom> from with a perl script this line does not work
ktom> `sed -e 1,14d $file >> /tmp/junk`;

ktom> it seems the redirect does not work.

I'm not going to answer any question where the poster is forging
addresses of both "nowhere.com" and "billgates.com", thus
polluting those domains for more spam and making replies difficult.

you have a very good point there.
PLEASE PEOPLE.

If you don't want replies, and don't want spam, DON'T USE A VALID
DOMAIN NAME.

I don't mind replies.
I don't want spam.

the real reply to address is ktomasek BLAT d2audio BLDOT com
You're being very unfair to people who own that domain name, either
now or in the future.

Use "example.com" or "anything.you.want.as.long.as.it.ends.with.invalid"

i have noticed a number of sites that check to make sure that you are
supplying a valid domain name before accepting a replyto or email
address. but that doesn't really apply to newsgroups.

i have modified the reply to address with the intent of acknowledging
your issues. is it sufficient??
 
B

Brian McCauley

ktom said:
Randal L. Schwartz wrote:

you have a very good point there.
i have modified the reply to address with the intent of acknowledging
your issues. is it sufficient??

No. Go back and read Randal's "very good point".

--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
 
T

Tad McClellan

ktom said:
how do i, or anyone else, find out what other domains are set aside as
'non-domains'?


How many non-domains do you need?

I cannot imagine needing more than one, and Randal already gave
more than one.


Put ".invalid" on the end of it and you're done!
 
T

Tassilo v. Parseval

Also sprach ktom:
how do i, or anyone else, find out what other domains are set aside as
'non-domains'?

Now it's ok. Brian was referring to the fact, that you used a correctly
munged reply-to address but hadn't changed your from address
accordingly.

Btw, the special domain example.com can always be used (it's not for
registration). Otherwise use a non-existing top-level domain as you have
done now with .invalid.

Tassilo
 
K

ktom

Tad said:
How many non-domains do you need?

i only need one, that wasn't the reason for the question.

the reason for the question is 'what other useful/interesting
information would i find at the same site'
 
S

Steve Grazzini

ktom said:
i only need one, that wasn't the reason for the question.

the reason for the question is 'what other useful/interesting
information would i find at the same site'

Google for RFC 2606.
 
H

Helgi Briem

nope, nothing stealth about it..
just plain old, where's the magic type question.

What Tony means is, "are you trying to run this
Perl script under CGI and not telling us about it?"
That's a "stealth CGI question".

CGI has a lot of special issues associated with it,
including permissions. CGI scripts run as a special
user (often named 'httpd', 'apache' or 'nobody')
with restricted privileges and an empty path
variable.

`sed -e 1,14d $file >> /tmp/junk`;

should be replaced by

system ("sed -e 1,14d $file >> /tmp/junk")
== 0 or die "Cannot run sed -e 1,14d $file >> /tmp/junk:$?";

(Why are you running sed to do something perl can
do easily?)

It is most likely that:

a) sed is not in path for httpd (give full path to sed)
b) httpd does not have permission to write to /tmp
c) httpd does not have permission to run sed. (chmod)
d) Your web server is misconfigured and you're not
running the script at all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,817
Members
47,362
Latest member
ChandaWagn

Latest Threads

Top