in reply to backtick operator
If you must have an outside script because it is used from other processes also, you could tidy that one up too with awk for example. The whole writing a temp file to extract a text field is very un-unix way of doing it.open(DBFILE,"~/.passwd"); while($line = <DBFILE>) { if ($line =~ /$dbname(\w+)(\w+)/) { $dbUser = $1; $dbPass = $2; } }
would give you the same fields as the getDBlogin script. The strange part about your log is that the log won't even show what came back from your backtick operation, at least you should seeawk '/^abc01/{ print $2 " " $3; }' ~/.passwd
by itself.tempStr:
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: backtick operator
by Anonymous Monk on May 13, 2010 at 21:32 UTC | |
by AndyZaft (Hermit) on May 13, 2010 at 22:03 UTC | |
by Anonymous Monk on May 14, 2010 at 03:11 UTC | |
by Anonymous Monk on May 14, 2010 at 06:41 UTC | |
by Hue-Bond (Priest) on May 14, 2010 at 06:54 UTC | |
|