hii Guyss..
This post is not related to shell scripting..
but i wanna say u in his post that..if u have any problem in shell scripting..
Plzzz let us know ..we contributor of this blog will try to answer ur problem
Attach ur problem as comment to this post......
Qs are welcome.....
Thank you...
Thursday, July 30, 2009
Wednesday, July 29, 2009
How can I see the O/P in a another Terminal?
If I wrote a script in a new Terminal. Then after I want to see the output of
that script in an another terminal. How Can I See that?
I have solution but if any one have direct command for it pl suggest me
You can find the name of the other terminal
i.e by
tty command you can see the name of the terminal
now you redirect the output to that terminal
tty
/dev/pts/0
tty
/dev/pts/1
echo "amit khatri">/dev/pts/1
you see the result on New terminal
that script in an another terminal. How Can I See that?
I have solution but if any one have direct command for it pl suggest me
You can find the name of the other terminal
i.e by
tty command you can see the name of the terminal
now you redirect the output to that terminal
tty
/dev/pts/0
tty
/dev/pts/1
echo "amit khatri">/dev/pts/1
you see the result on New terminal
Thursday, July 16, 2009
see the difference...
hii frnds..
now a interesting thing about the buffer used at the terminal on unix..
suppose the following C code is running on any unix system..
$ cat test.c
#include
int main()
{
printf("Hello\n");
if(fork()==0)
printf("World\n");
return 0;
}
$ gcc test.c
$ ./a.out
Hello
World
$ ./a.out>test
Hello
World
Hello
$
why output is different in two cases..
It is the difference between the buffer used for terminal standard output and the other ordinary file..if output is to be be shown on the terminal line buffer is used i.e. when it encounters '\n' it flushes out buffer content..but in case of other file buffer content is flushed out only when it is full..in the above code..that's why when child is run Hello is retained there in buffer and Hello is printed twice in case when output is redirected to file.But when it runs directly Hello is printed only one time..as there is '/n' which flushes out the buffer content.So Hello is printed only when parent is running..when '\n' is ommited..output will be same in both cases.Try it yourself.
Thank you...
now a interesting thing about the buffer used at the terminal on unix..
suppose the following C code is running on any unix system..
$ cat test.c
#include
int main()
{
printf("Hello\n");
if(fork()==0)
printf("World\n");
return 0;
}
$ gcc test.c
$ ./a.out
Hello
World
$ ./a.out>test
Hello
World
Hello
$
why output is different in two cases..
It is the difference between the buffer used for terminal standard output and the other ordinary file..if output is to be be shown on the terminal line buffer is used i.e. when it encounters '\n' it flushes out buffer content..but in case of other file buffer content is flushed out only when it is full..in the above code..that's why when child is run Hello is retained there in buffer and Hello is printed twice in case when output is redirected to file.But when it runs directly Hello is printed only one time..as there is '/n' which flushes out the buffer content.So Hello is printed only when parent is running..when '\n' is ommited..output will be same in both cases.Try it yourself.
Thank you...
Subscribe to:
Posts (Atom)