02-01-2007
On Solaris sytems you can:
The script:
-------------------------
#!/usr/bin/ksh
pfiles $$
-------------------------
The command line:
-------------------------
./test.sh > out 2> out2
-------------------------
The output (in the file "out")
-------------------------
$ cat out
19888: /usr/bin/ksh ./test.sh
Current rlimit: 256 file descriptors
0: S_IFCHR mode:0620 dev:283,0 ino:12582918 uid:107 gid:7 rdev:24,1
O_RDWR|O_NOCTTY|O_LARGEFILE
/devices/pseudo/pts@0:1
1: S_IFREG mode:0640 dev:85,60 ino:2023 uid:107 gid:150 size:0
O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE
/export/home/XXXXX/out
2: S_IFREG mode:0640 dev:85,60 ino:2027 uid:107 gid:150 size:0
O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE
/export/home/XXXXX/out2
62: S_IFREG mode:0750 dev:85,60 ino:456 uid:107 gid:150 size:26
O_RDONLY|O_LARGEFILE FD_CLOEXEC
/export/home/XXXXX/test.sh
-------------------------
The Output shows the file descriptors
1 for stdout (redirected to file "out")
1: S_IFREG .............
The last line shows the file whereto stdout has been redirected to.
/export/home/XXXXX/out
2: for stderr (redirected to the file "out2")
2: S_IFREG .............
Again, the last line shows the file whereto stderr has been redirected to.
/export/home/XXXXX/out2
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
What command do I use in order to save a file in directory A/B/C
to directory A/D/E. (1 Reply)
Discussion started by: JSP
1 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I have a shell script in which there is a file
conn_$temp
where $temp has the pid of the shell script.
in this shell script i have an embedded awk script that must read the file
while ((getline < "conn_$temp") > 0)
However due to the "$temp" in the file name, the awk script is... (6 Replies)
Discussion started by: HIMANI
6 Replies
3. UNIX for Dummies Questions & Answers
I have to confirm that an engine was not able to run. In the output below you see that it indeed got errors, but it didn't send those messages to the output file. When I run the same thing with a different executable it works. So does this mean something in the executable could cause it not to... (7 Replies)
Discussion started by: brdholman
7 Replies
4. UNIX for Dummies Questions & Answers
I have a question. I am not even sure if it can be done. But if it could be then I would needs a lot of help. ok, I work for a software company and we have a store. The store log files are in a unix server and the log file is dynamically updated everytime some error occurs in the store. So we often... (1 Reply)
Discussion started by: skrules
1 Replies
5. Shell Programming and Scripting
I have a file (email) containing email addresses.
I have a second file (terms) that contains simple regular expressions and words/characters. Here are some examples:
\.trainee
\.group
\.web
I want to go through email and delete lines containing the expressions/words from terms and write... (1 Reply)
Discussion started by: manouche
1 Replies
6. UNIX for Dummies Questions & Answers
Hi All,
I am having a script which calculate checks the input feed and perform some function. When i am executing this script i am redirecting this to a output file. I want to know the redirected output file name inside my scripts. Is there is any way to get that .
like the same way we... (4 Replies)
Discussion started by: arunkumar_mca
4 Replies
7. Shell Programming and Scripting
emailid=myemail@xyz.com
taskName="DB-Backup"
starttime=`date`
email()
{
subject="$taskName" ": " $* " at `date` "
mutt -s "$subject" $emailid < /dev/null
}
email "Starting"
#do my stuff
email "Finished"
The above code gives following error
./dbbackup.sh: line 6: :... (5 Replies)
Discussion started by: nitiraj.rathore
5 Replies
8. Shell Programming and Scripting
Below is hash which contains reference to variables:
my %mandatoryFields = (
1 => \$msgtype,
2 => \$switchtype,
3 => \$card_nbr,
4 => \$natv_tran_type_code,
5 => \$amt_1
);
This... (0 Replies)
Discussion started by: som.nitk
0 Replies
9. Shell Programming and Scripting
Hi,
GetName()
{
if
then
echo " Please enter the name: "
read Name
tempvar=0
while read line
do
if
then
tempvar=`expr $tempvar + 1`
echo $tempvar
... (10 Replies)
Discussion started by: rituparna_gupta
10 Replies
10. Shell Programming and Scripting
Hi
echo " username "
read username
echo "password"
stty -echo
read password
stty echo
through read i am taking standard input and redirecign them to a file
echo " username=${username}/${password} " > file.lst
now from the same shell script i want to delete the password (i.e... (4 Replies)
Discussion started by: rosheks
4 Replies