anijan
1
hi,
can anyone explain the significance of the pr command in the below shell script
temp="/home/input.$$"
pr -e -t >$temp
when i tried executing from the shell , the file in $temp is emptied and the shell execution never comes to an end. please explain.
You haven't supplied a filename for pr to read, so it is reading from the standard input, i.e., the terminal.
anijan
3
ok im giving input from the terminal. and terminating it with ctrl+d.
thse are the three lines of the actual code.
temp="/home/input.$$"
pr -e -t >$temp
cut -c1-1 $temp >$temp2
i see that it pastes the first characters of $temp in $temp1. wat is the use of pr command here.?
wat is the use of giving input from the terminal as it is savd nowhere.?
Please put code inside
tags:
temp="/home/input.$$"
pr -e -t >$temp
cut -c1-1 $temp >$temp2
i see that it pastes the first characters of $temp in $temp1.
[/quote]
[indent]
You haven't done anything with $temp1; it's not defined or used anywhere. Do you mean "$temp2"?
Have you read the man page?
It is saved (in "$temp").
anijan
5
Thnks for ur help..Sorry it was a mistake from my side. its temp2 and not temp1.
It is working fine now..