Re: How to get a called perl script to write output to a file with DIFFERENT user:group than the calling app?

2017-01-16 Thread Chris Fedde
Other comments on this question discuss elevating user permissions via suid, sudo the setuid bit and so on. There are good reasons to need to create files with owner/group that are different from your own, they usually come up in system administration situations. Most common situation where access

Re: How to get a called perl script to write output to a file with DIFFERENT user:group than the calling app?

2017-01-15 Thread Chas. Owens
snip > So I guess the question is - > > - is there a way in perl to authorize the callED perl script to have > higher perms than the callING app's, so that it can write to the file I'm > targeting? > > Or do I have to to this OUTSIDE of the perl script? > The short answer is that this is OS depen

Re: How to get a called perl script to write output to a file with DIFFERENT user:group than the calling app?

2017-01-15 Thread alanj
> Is that your real program Close, but copied from my (changing) notes, not from the actual code. See below. > but changing something to the same data amounts to it being *unchanged*, > surely? Nope. Not using Path::Tiny. I found the info I need buried a further donw on its webpage. Appare

Re: How to get a called perl script to write output to a file with DIFFERENT user:group than the calling app?

2017-01-15 Thread Rob Dixon
Hi Is that your real program, because it's rather odd? The built-in variable `$@` holds the message from the latest error to be trapped by `eval`, so since you have no `eval` blocks it will probably be `undef`. Did you mean to assign the command-line parameter, like this? my ($newdata) = @

How to get a called perl script to write output to a file with DIFFERENT user:group than the calling app?

2017-01-15 Thread alanj
I have an application that calls a perl script, feeding it input over STDIN. The perl script takes that input, processes it, and writes is as a change to an output file. I use Path::Tiny, and this works ok, use Path::Tiny qw(path); my $newdata = $@; $newdata = (some pro

Re: calling a program from a perl script and redirecting to output to a file

2009-03-04 Thread rajgupta85
On Mar 2, 2:49 pm, teva...@gmail.com (Thomas Evangelidis) wrote: > Hi again, > > I'm digging out this thread cause it seems that my problem has been only > partially solved. Indeed "my @myout = `program file`;" can save the output > of my program to an array for parsing but this doesn't happen when

Re: calling a program from a perl script and redirecting to output to a file

2009-03-02 Thread Thomas Evangelidis
Hi again, I'm digging out this thread cause it seems that my problem has been only partially solved. Indeed "my @myout = `program file`;" can save the output of my program to an array for parsing but this doesn't happen when I use programs with output that cannot be redirected to a file (i.e. erro

RE: calling a program from a perl script and redirecting to output to a file

2009-02-19 Thread Wagner, David --- Senior Programmer Analyst --- CFS
> -Original Message- > From: Thomas Evangelidis [mailto:teva...@gmail.com] > Sent: Thursday, February 19, 2009 08:27 > To: beginners@perl.org > Subject: calling a program from a perl script and redirecting > to output to a file > > Dear Perl programmers, >

RE: calling a program from a perl script and redirecting to output to a file

2009-02-19 Thread Wagner, David --- Senior Programmer Analyst --- CFS
ilto:teva...@gmail.com] > > > Sent: Thursday, February 19, 2009 08:27 > > > To: beginners@perl.org > > > Subject: calling a program from a perl script and redirecting > > > to output to a file > > > > > > Dear Perl programmers, > > > >

Re: calling a program from a perl script and redirecting to output to a file

2009-02-19 Thread James Moser
mas 2009/2/19 Wagner, David --- Senior Programmer Analyst --- CFS < david.wag...@fedex.com> -Original Message- From: Thomas Evangelidis [mailto:teva...@gmail.com] Sent: Thursday, February 19, 2009 08:27 To: beginners@perl.org Subject: calling a program from a perl script and redirect

Re: calling a program from a perl script and redirecting to output to a file

2009-02-19 Thread Thomas Evangelidis
: Thursday, February 19, 2009 08:27 > > To: beginners@perl.org > > Subject: calling a program from a perl script and redirecting > > to output to a file > > > > Dear Perl programmers, > > > > I want to run a program from a perl script and redirect th

calling a program from a perl script and redirecting to output to a file

2009-02-19 Thread Thomas Evangelidis
Dear Perl programmers, I want to run a program from a perl script and redirect the its output to a file. The programs is called apbs and takes 1 argument, so in unix shell I 'm simply typing the following: $apbs input.in >$ output.txt # '>' doesn't work here When u

Re: Writing output to a file

2008-06-19 Thread [EMAIL PROTECTED]
On Jun 18, 7:12 pm, [EMAIL PROTECTED] (Dakin999) wrote: > Hi, I am trying to write the script myself and now stuck at some > thiong that I am pretty sure have been done by others. Any help will > be significant. > > Ok, I have created an array and now I want to read from this array the > elements a

Re: Writing output to a file

2008-06-19 Thread yitzle
On Wed, Jun 18, 2008 at 8:12 PM, dakin999 <[EMAIL PROTECTED]> wrote: > Hi, I am trying to write the script myself and now stuck at some > thiong that I am pretty sure have been done by others. Any help will > be significant. > > Ok, I have created an array and now I want to read from this array the

Writing output to a file

2008-06-19 Thread dakin999
Hi, I am trying to write the script myself and now stuck at some thiong that I am pretty sure have been done by others. Any help will be significant. Ok, I have created an array and now I want to read from this array the elements and put them in a LDIF format. Something like this: dn: uid=xxx,cn=

Re: Write the output to a file

2007-12-13 Thread Dermot
On 12/12/2007, Chas. Owens <[EMAIL PROTECTED]> wrote: > > On Dec 12, 2007 7:08 AM, Dr.Ruud <[EMAIL PROTECTED]> wrote: > > > Your last comment line ("it will close here") I would put inside the > > block, or I would say "is closed with the block". > > (I am all for lexical comments.) > snip > > I ca

Re: Write the output to a file

2007-12-12 Thread Chas. Owens
On Dec 12, 2007 7:08 AM, Dr.Ruud <[EMAIL PROTECTED]> wrote: > "Chas. Owens" schreef: snip > > } #unless a reference was made to $fh it will close here snip > Your last comment line ("it will close here") I would put inside the > block, or I would say "is closed with the block". > (I am all for lexi

Re: Write the output to a file

2007-12-12 Thread Dr.Ruud
"Chas. Owens" schreef: > Dr.Ruud: >> Chas. Owens: >>> (you should close file handles once you >>> stop using them because they are a limited resource). >> >> I often start a new block at opening a file. > > If you are using the new scalar based file handles this is a good > practice since they aut

Re: Write the output to a file

2007-12-12 Thread Chas. Owens
On Dec 12, 2007 4:46 AM, Dr.Ruud <[EMAIL PROTECTED]> wrote: > "Chas. Owens" schreef: > > > (you should close file handles once you > > stop using them because they are a limited resource). > > I often start a new block at opening a file. snip If you are using the new scalar based file handles this

Re: Write the output to a file

2007-12-12 Thread Dr.Ruud
"Chas. Owens" schreef: > (you should close file handles once you > stop using them because they are a limited resource). I often start a new block at opening a file. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: Write the output to a file

2007-12-11 Thread Chas. Owens
On Dec 11, 2007 2:10 AM, patmarbidon <[EMAIL PROTECTED]> wrote: > Patrick Marion has written: > I think that your 'close (OUTPUT)' is inside the sub 'pits' > > you might put it before 'sub pits {' to get it at the logiccal end of > your program. snip Or remove the close completely. Perl closes al

Re: Write the output to a file

2007-12-11 Thread John W . Krahn
On Monday 10 December 2007 21:50, John Jack wrote: > > Hi Group Hello, > I'm new to perl and haven't used it before. I'm still practising and > trying my best to know it. Anyway, I wanted to print the list of > files in a directory with their full pathnames. This script below > worked fine but I

Re: Write the output to a file

2007-12-10 Thread patmarbidon
Patrick Marion has written: I think that your 'close (OUTPUT)' is inside the sub 'pits' you might put it before 'sub pits {' to get it at the logiccal end of your program. John Jack has written : Hi Group I'm new to perl and haven't used it before. I'm still practising and trying my best to

Write the output to a file

2007-12-10 Thread John Jack
Hi Group I'm new to perl and haven't used it before. I'm still practising and trying my best to know it. Anyway, I wanted to print the list of files in a directory with their full pathnames. This script below worked fine but I want to write it to a file. Can someone help me, please? I know it must

Re: I/O: Can't Output to a File

2005-08-22 Thread John W. Krahn
Ryan Frantz wrote: > Perlers, Hello, > I'm stumped; I have a script that should output to a file but it > doesn't. The file is created, but it's empty after the script > completes. To be sure I was getting some sort of output, I had the > script write to the termi

RE: Can't Output to a File

2005-08-22 Thread Ryan Frantz
> -Original Message- > From: Ryan Frantz > Sent: Monday, August 22, 2005 11:32 AM > To: Beginners Perl > Subject: I/O: Can't Output to a File > > Perlers, > > I'm stumped; I have a script that should output to a file but it > doesn't.

I/O: Can't Output to a File

2005-08-22 Thread Ryan Frantz
Perlers, I'm stumped; I have a script that should output to a file but it doesn't. The file is created, but it's empty after the script completes. To be sure I was getting some sort of output, I had the script write to the terminal and all was well. The odd thing, however,

RE: printing output to a file

2002-09-09 Thread Nandita Mullapudi
Thanks ALL for the quick help! i realised my mistake, "open" shd be outside the loop.. :) :) (scripts that work, very pleasing!) nandita -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: printing output to a file

2002-09-09 Thread david
James Edward Gray II wrote: >> open (OUT, '>outputfile.txt') or die "couldn't"; >> print OUT "$key\n\n", $alignments{$key}, >> "\nXXX\n" the reason is in these 2 lines(especially the open() thingy). whenever you ask Perl to open something for writing, Perl turncate t

Re: printing output to a file

2002-09-09 Thread James Edward Gray II
You're real close to what you need here. You're just reopening (and clearing) that file every time through the for loop. Move that open statement to above the loop and everything will start working fine. Good luck. James On Monday, September 9, 2002, at 11:49 AM, Nandita Mullapudi wrote:

RE: printing output to a file

2002-09-09 Thread Timothy Johnson
09, 2002 9:49 AM To: [EMAIL PROTECTED] Subject: printing output to a file hello list i am trying to print the output of a parsing script to a file- the way it is right now, the print commands are within a foreach loop, and it prints to the screen. in order to get the entire output into a file, i

RE: printing output to a file

2002-09-09 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Mullapudi [mailto:[EMAIL PROTECTED]] Sent: Monday, September 09, 2002 09:49 To: [EMAIL PROTECTED] Subject: printing output to a file hello list i am trying to print the output of a parsing script to a file- the way it is right now, the print commands are within a foreach loop, and it prints to the s

printing output to a file

2002-09-09 Thread Nandita Mullapudi
hello list i am trying to print the output of a parsing script to a file- the way it is right now, the print commands are within a foreach loop, and it prints to the screen. in order to get the entire output into a file, i'm using a simple set of commands like so: foreach my $key (keys %a

RE: Sending command output to a file

2001-09-25 Thread Kipp, James
/c0t0d0s0` and write some code to print to a file > -Original Message- > From: Lance Martincich [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 25, 2001 2:09 AM > To: [EMAIL PROTECTED] > Subject: Sending command output to a file > > > Hi > > I am

Sending command output to a file

2001-09-24 Thread Lance Martincich
Hi I am writing a script to automate a number of ufsdumps we do on our sun boxes. The script I am using works fine, however I wish to send the output of the ufsdump commands to a file and not display the output on the screen. The main reason is that this file will store other info pertaining

RE: Output to a file.

2001-05-31 Thread blowther
lto:[EMAIL PROTECTED]] Sent: Thursday, May 31, 2001 5:42 PM To: [EMAIL PROTECTED] Subject: Output to a file. I've never written a line of perl before ... and I've only been lurking on the list for three hours or so. But I've been presented some code which was written for Unix and I

Re: Output to a file.

2001-05-31 Thread Me
> When this is done running will it > generate a file called sitelist.str.fo ? Based on a quick glance at the script, the stuff after the __END__ token is not being used by the script. So... > if($QWFLAT eq '') > { > print "Enter QW flatfile file name -> "; > chomp($QWFLAT = ); > } Thi

Output to a file.

2001-05-31 Thread Robert . Clayton
I've never written a line of perl before ... and I've only been lurking on the list for three hours or so. But I've been presented some code which was written for Unix and I'm trying to run on NT using ActiveState Perl. It converts a flat file from the USGS to a format we can get into our SQL dat