Timeline for How to print only defined variables (shell and/or environment variables) in bash
Current License: CC BY-SA 2.5
        4 events
    
    | when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 11, 2011 at 18:13 | history | edited | Steven D | CC BY-SA 2.5 | 
                
                    deleted 1 characters in body 
                
             | 
| Oct 26, 2010 at 19:01 | comment | added | Gilles 'SO- stop being evil' | The problem with your command is not portability (it's specific to bash, of course, but there's no problem on the grep side). The problem is that you're grabbing some lines in function definitions. Bash indents most of the function code, but not all of it, in particular not text inside here documents ( f () {|cat <<EOF|foo=bar|EOF|}where|represents a line break). | |
| Oct 26, 2010 at 4:07 | history | edited | Steven D | CC BY-SA 2.5 | 
                
                    deleted 2 characters in body 
                
             | 
| Oct 26, 2010 at 3:59 | history | answered | Steven D | CC BY-SA 2.5 |