Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 2,288
Thanks Given: 430
Thanked 480 Times in 395 Posts
Hi.
Quote:
Originally Posted by new2learn09
I want to know what the "echo 1>&2" means ...
When a program runs, 3 files are made available: STDIN (0), STDOUT (1), and STDERR (2), all assigned to the terminal.
Often programs are connected together into pipelines, where the STDOUT of a program is connected to the STDIN of another program. If a program were to write an error message to STDOUT, it could be swallowed down the pipeline. Consequently,a good practice is to specify that error messages be written to STDERR.
If we were to write :
the message would be written on file "2". So the shell uses the convention that "&2" will be whatever STDERR is assigned to. So we write:
Because STDERR is normally assigned to the terminal, the user is likely to notice it. (The "1" in "1>&2" is understood, and may be omitted.)
The placement of "1>&2" can be anywhere where it is directly exposed to the shell:
but I have seen it in most situations at the end of the statement.
Hi ,
I have a code where i am using a infinite while loop . some thing like below
while
do
if
then
#go to line 20
fi
command 1;
command 2;
#line 20:
sleep 34; (5 Replies)
Hi,
I want to remove the following code from Source files (or replace the code with empty.) from all the source files in given directory.
finally {
if (null != hibernateSession && hibernateSession.isOpen()) {
//hibernateSession.close();
}
}
It would be great if the script has... (2 Replies)
hi all,
Can any 1 help me translate this korn shell code to C shell code :
email=$(grep "^$1" $folder/config_2.txt | awk '{print $2'})
In config_2.txt the content is :
which mean in korn shell , $1=groupname and $2=email address.
Now i need to write in C shell script,when i set the... (2 Replies)
Hi Guys,
I was just wondering if anybody can help me with this problem.
OK, how we can get a value back from PL/SQL Script (not stored procedure/function)
See the below example: (for example aaa.sh)
#!/bin/ksh
VALUE=`sqlplus -s user/password@test_id <<EOF
@xxx.sq
EOF`
echo $VALUE
... (7 Replies)