in reply to substr Rampage
That removes all comments and lines that are commented out. (It also removes the initial "shebang" line, but we don't need to see that anyway.)perl -ne 'print unless /^\s*#/' your_script_file
I was going to suggest there might be a problem here:
but then I remembered that the OS will automatically ignore repeated slashes in file path strings. Still, you don't need to double the slashes (it's the backslash that needs to be doubled in order to get a literal backslash: \\). And you really should check whether the open() succeeded, even for that file; it's just a good habit.open (PASSWDFILE, "//etc//passwd");
Welcome to the Monastery!
|
|---|