Xref: utzoo comp.sys.att:3081 unix-pc.general:604 Path: utzoo!mnetor!uunet!uvm-gen!banzai!john From: john@banzai.UUCP (John Canning) Newsgroups: comp.sys.att,unix-pc.general Subject: Re: lint -I Message-ID: <125@banzai.UUCP> Date: 22 Apr 88 13:55:55 GMT References: <8723@sol.ARPA> <350@manta.UUCP> Reply-To: john@banzai.UUCP (John Canning) Organization: People's Computer Company, Burlington, VT Lines: 49 Summary: It's ksh's fault I hate to spoil the fun of blaming AT&T for lint -I/foobar/include not working the way you want it to, but if you make your $SHELL variable use /bin/sh instead of /bin/ksh, it works quite nicely. The ksh interprets one of the lines inside the lint script a tad differently than sh would. This has something to do with the way it handles backslashes inside of single vs. double quotes. If you want to make lint work properly when run under the korne shell, change line 55 so that it reads as follows (this will work for ksh as well as sh): O=`echo $OPT | sed "s/\\(.\\).*/\\1/p"` The original line used single quotes in place of double quotes. In case you want more detail as to what this line does, or where it really is, keep reading... The line appears in a case statement which tries to parse out the options. When it finds a -, it starts to look for another ONE character option. Under the ksh, the line is interpreted so that the sed script looks for the next word, rather than just the next character. Changing the single quotes to double quotes will make the ksh work correctly. Here is the original line in context: case "$OPT" in *.c) FILES="$FILES $OPT" NDOTC="x$NDOTC";; *.ln) FILES="$FILES $OPT";; -*) OPT=`echo $OPT | sed s/-//p` while [ "$OPT" ] do O=`echo $OPT | sed 's/\\(.\\).*/\\1/p'` OPT=`echo $OPT | sed s/.//p` case $O in p) LINTF="$LINTF -p" . . . I hope this clears up the confusion over lint and its bugs... John Canning The People's Computer Company Burlington, Vermont