skip to main
|
skip to sidebar
Stas's blog
Thursday, March 4, 2010
Redirecting or error output to variable in shell
Spent couple of painful hours trying to do that. And eventually, here is the code which will output standard output into the file and error into the variable:
var=`(ls -l > ./file.txt) 2>&1`
bloody shell...
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Subscribe To
Posts
Atom
Posts
Comments
Atom
Comments
Blog Archive
►
2015
(1)
►
January
(1)
►
2013
(4)
►
May
(1)
►
March
(2)
►
February
(1)
►
2012
(6)
►
December
(2)
►
October
(1)
►
September
(1)
►
May
(1)
►
February
(1)
►
2011
(6)
►
December
(1)
►
November
(1)
►
July
(3)
►
January
(1)
▼
2010
(12)
►
November
(1)
►
October
(1)
►
August
(1)
►
May
(1)
►
April
(1)
▼
March
(4)
Public key infrastructure
Mac in 1984
Redirecting or error output to variable in shell
Java bridge methods explained
►
February
(2)
►
January
(1)
►
2009
(5)
►
December
(1)
►
October
(1)
►
August
(1)
►
February
(2)
►
2008
(1)
►
August
(1)
Labels
algorithms
(1)
architecture
(3)
cache
(1)
concurrency
(3)
concurrenthashmap
(1)
cryptography
(1)
ehcache
(1)
exceptions
(1)
fitnesse
(1)
git
(1)
hibernate
(2)
ide
(1)
idea
(1)
io
(2)
java
(23)
javac
(1)
jcaptcha
(1)
jetty
(1)
jgroups
(1)
JLS
(1)
jmm
(1)
jvm
(2)
keytool
(1)
linux
(4)
mvc
(1)
NIO
(1)
openjdk
(1)
opensource
(1)
performance
(10)
PKI
(1)
quicksort
(1)
regexp
(1)
rmi
(1)
scala
(1)
security
(1)
shell
(2)
sort
(1)
spring
(2)
teamcity
(1)
trading
(1)
About Me
Unknown
View my complete profile
Links
My Amazon Wish List
No comments:
Post a Comment