bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

functions, process substitution, bad file descriptor


From: Ben Hyde
Subject: functions, process substitution, bad file descriptor
Date: Fri, 27 Feb 2009 09:26:29 -0500

I ran into a problem using process substitution. A much reduced version is show below. The function f2 has the problem, the function f1 does not. Are
there is some facts about the life cycle of the files created by
process substitution I don't appreciate?  - ben

bash-3.2$ ls -l /tmp/foo
-rwxr-xr-x  1 bhyde  wheel  105 Feb 27 09:13 /tmp/foo

bash-3.2$ cat /tmp/foo
#!/bin/bash
f1(){
  cat $1
  date
}
f2(){
  date
  cat $1
}
cat <(echo hi)
f1 <(echo bye)
f2 <(echo l8r)

bash-3.2$ bash --version
GNU bash, version 3.2.17(1)-release (i386-apple-darwin9.0)
Copyright (C) 2005 Free Software Foundation, Inc.

bash-3.2$ /tmp/foo
hi
bye
Fri Feb 27 09:18:45 EST 2009
Fri Feb 27 09:18:45 EST 2009
cat: /dev/fd/63: Bad file descriptor
bash-3.2$



reply via email to

[Prev in Thread] Current Thread [Next in Thread]