06-29-2007
<stdin> by default, points to the terminal/keyboard.
But it is not always true if you redirect or use pipes.
In other words, there are three ways that <stdin> can be used:
1) Terminal/keyboard, by default: cut -c2<enter>
2) Redirection of a file: cut -c2 input_file OR cut -c2 < input_file
3) Use of pipes: echo "abc123" | cut -c2
10 More Discussions You Might Find Interesting
1. UNIX Desktop Questions & Answers
ehe may i know what are the difference between Unix & Linux, and what are the advantages of having Unix as well as disadvantages of having Unix or if u dun mind i am dumb do pls tell me what are the advantages as well as the disadvantages of having linux as well. thanks (1 Reply)
Discussion started by: cybertechmkteo
1 Replies
2. UNIX for Advanced & Expert Users
:confused: Hi All
Can anyone help me in finding the answer of the question mentioned below.
What is the difference between Unix & linux ?
Thanks in Advance to all
CSaha (1 Reply)
Discussion started by: csaha
1 Replies
3. Shell Programming and Scripting
For executing a shell script, i know 2 ways:
1) using sh command
2) making the script file executable & then use ./
But i can across another way for executing the scripts... using ". ./"
I tried this way.. but i was able to understand the difference between "./" and ". ./"
I would be very... (2 Replies)
Discussion started by: abishekmag
2 Replies
4. UNIX for Dummies Questions & Answers
I've come stuck when I was making sure the hour of the day was not been two times so that the rest of the script could not be executed.
Seems simple enough.
I used the -a to join the two conditions together and it would run if the conditions was t/f ( it is only supposed to run if was t/t).... (3 Replies)
Discussion started by: spookyrtd99
3 Replies
5. Programming
Hi,
Program A: uses pipe()
I am able to read the stdout of PROGAM B (stdout got through system() command) into PROGRAM A using:
* child
-> dup2(fd, STDOUT_FILENO);
-> execl("/path/PROGRAM B", "PROGRAM B", NULL);
* parent
-> char line;
-> read(fd, line, 100);
Question:... (2 Replies)
Discussion started by: vvaidyan
2 Replies
6. UNIX for Advanced & Expert Users
I am trying to automate a SSH login using Keys using the following command
ssh -i id_rsa usernamw@ipaddr.
I am successful in doing this and i am getting the Warning Screen and I logon successfully.
but when I am executing the command
tail -1cf put.dat | ssh -i id_rsa username@ipaddr > get.dat ... (1 Reply)
Discussion started by: Shivdatta
1 Replies
7. Solaris
Hello Everybody
I would like to know any major difference between sudo & RBAC as I am bit familiar with RBAC but not with sudo (2 Replies)
Discussion started by: girish.batra
2 Replies
8. Shell Programming and Scripting
Hi All,
Solarix/Bash v3x
Im trying to output any standard errors created by the script to a file using the below command:
. runDTE.sh 2> "$DTE_ERROR_FILE"
however the errors do get written to the dir/file stored in $DTE_ERROR_FILE but the error does not appear on the terminal screen in... (4 Replies)
Discussion started by: satnamx
4 Replies
9. UNIX for Dummies Questions & Answers
I see these terms used all the time with hardly any distinction between the two.
Any clarification would be appreciated!:) I could only get emacs to open in console so I was also wondering what are the common applications to use in console.:wall: (7 Replies)
Discussion started by: theKbStockpiler
7 Replies
10. UNIX for Dummies Questions & Answers
Hi All,
Can anyone please help me understanding what the difference between the below two?
1. script.sh &
2. nohup script.sh & (2 Replies)
Discussion started by: Anupam_Halder
2 Replies
LEARN ABOUT HPUX
tcgetsid
tcgetsid(3C) tcgetsid(3C)
NAME
tcgetsid() - get terminal session ID
SYNOPSIS
DESCRIPTION
The function returns the value of the session ID of the foreground process associated with the terminal referenced by fildes. is allowed
from a process that is a member of a background process group (see termio(7)).
RETURN VALUE
Upon successful completion, returns the value of the session ID of the foreground process associated with the terminal referenced by
fildes. Otherwise, returns a value of and sets to indicate the error.
ERRORS
If the function fails, it sets (see errno(2)) to one of the following values:
[EACCES] The file associated with fildes is the controlling terminal of the calling process; however, there is no foreground
process group defined for the controlling terminal.
[EBADF] fildes is not a valid file descriptor.
[ENOTTY] The file associated with fildes is not the controlling terminal or the calling process does not have a controlling
terminal.
SEE ALSO
getsid(2), setsid(2), tcgetpgrp(3C), thread_safety(5).
tcgetsid(3C)