When I run this on the command line it works:
ls | grep -v "#$"
But when I do ls | scriptname and inside the script I have:
#fileformat=unix
#!/bin/bash
grep -iv '#$'
It's not working. Why?
[EDIT]
the reason for the first line is explained here.
besides that even if i remove the first two lines it SHOULD work. i tried the exact same on a remote Solaris account and it did work. so is it my Fedora installation?
#fileformat=unixin your file is, strictly a comment. Note that the link you include, they are refering to editing a file with thevieditor AND that the exact usage is: fileformat=unix(note the ':' char). Text like:var=valueis vi speak for 'set a vi option', in this case, fileformat=unix means 'use only \n (LF) char at end of line NOT the DOS version of \r\n (CR,LF). Other posters are correct, you don't want #f.. at the top!