XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).
Moderator: General Moderators
jyhm
Forum Contributor
Posts: 228 Joined: Tue Dec 19, 2006 10:08 pm
Location: Connecticut, USA
Contact:
Post
by jyhm » Thu Feb 15, 2007 1:47 am
Code: Select all
#These work.
command -flags $variable > myfile.txt
command -flags $variable 2> myfile.txt
command -flags $variable >> myfile.txt
command -flags $variable 2>> myfile.txt
command -flags $variable &> myfile.txt
# But its choking when I do this
command -flags $variable &>> myfile.txtAnyone have any idea? I need to be able to append both
std and
std err to the same file.
Jenk
DevNet Master
Posts: 3587 Joined: Mon Sep 19, 2005 6:24 am
Location: London
Post
by Jenk » Thu Feb 15, 2007 6:06 am
Code: Select all
command -flags $variable 1>> myfile.txt 2>&1
jyhm
Forum Contributor
Posts: 228 Joined: Tue Dec 19, 2006 10:08 pm
Location: Connecticut, USA
Contact:
Post
by jyhm » Thu Feb 15, 2007 2:06 pm
Thanks Jenk,
You truley are a beautiful cow!
Is it possible to direct the result of a command into a variable? If the the result is blank I still need to have a place holder so that I can set up an array value as "N/A" or what ever.
Jenk
DevNet Master
Posts: 3587 Joined: Mon Sep 19, 2005 6:24 am
Location: London
Post
by Jenk » Fri Feb 16, 2007 9:36 am
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098 Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia
Post
by Chris Corbyn » Fri Feb 16, 2007 10:04 am
Or this:
Code: Select all
VARIABLE=$(command)
#works for arrays too
x=$(find . -name '*.*')
#or
y=$(ls -lR)