Results 1 to 1 of 1
Hello,
I'm all new to the world of shell scripting so please excuse my ignorance here.
The script below was originaly created on a HPUX system and has now been ...
- 03-31-2008 #1Just Joined!
- Join Date
- Dec 2006
- Posts
- 16
Invalid file descriptor issue
Hello,
I'm all new to the world of shell scripting so please excuse my ignorance here.
The script below was originaly created on a HPUX system and has now been moved across to a Red Hat linux system. Everytime I run this script I get the following error:-
line 2: read: 4: invalid file descriptor: Bad file descriptor
Can you please point me in the right direction as to what needs changing to resolve my problem.
Thanks
Code:exec 4<$1 while read -u4 next_rec; do echo $next_rec|awk -F "|" '{print $7}'|read expiry if [ "$expiry" = "00000000" ] then echo $next_rec|awk -F "|" '{print $1"|"$2"|"$3"|"$4"|"$5"|"$6"|03312008|"$8"|"$9"|"$10"|"$11"|"$12"|"}' >> new.dat else echo $next_rec >> new.dat fi done


Reply With Quote