It's not really clear why you can't use the variable. The way it is now, I don't think it contains a useful value (what does the
echo print for you?) but fixing the scripts so it works sounds like the best plan unless you can explain why it "simply doesn't work".
Assuming $x is the name of the file you are about to split, try something like this instead.
Code:
y=`wc -l < $x | awk '{ print 1+int($1/50) }'`
I put in the addition of one on the theory that this should do something vaguely useful even with files which are too small, with a slight bias towards making the last file in the series smaller than the others. (Maybe divide by 49 instead to compensate?)