Well, you probably have a solution by now but anyway:
Replace each "~" below with a "<" !!
SQL> create table t (filename varchar2(40), lines number);
#!/usr/bin/ksh
INDIR=/dbd01/data/in
F1=my_file.dat
LINES_F1=`wc -l ${INDIR}/${F1} | awk '{ print $1 }'`
sqlplus -s scott/tiger@engdev ~~EOF > log.txt
set pagesize 0 feedback off verify off heading off echo off
insert into t values ('$F1', $LINES_F1);
exit;
EOF
SQL> select * from t;
FILENAME LINES
---------------------------------------- ----------
my_file.txt 4