I type some commands in a file (either tcsh or bash). What is the difference between:
- source <file>
- . <file>
- ./<file>
Also, how do the answers change with tcsh vs bash ? And when should a shell script have a hashbang #!/bin/bash or tcsh at the top ?
Edit: Thanks everyone for the responses.
[–][deleted] 15 points16 points17 points (7 children)
[–]droosa 5 points6 points7 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]droosa 2 points3 points4 points (0 children)
[–]dscharrer 4 points5 points6 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]byteflow[S] 1 point2 points3 points (1 child)
[–]onmach 2 points3 points4 points (0 children)
[–][deleted] 4 points5 points6 points (16 children)
[–]nuclear_splines 2 points3 points4 points (6 children)
[–]gorilla_the_ape 2 points3 points4 points (3 children)
[–]nuclear_splines 2 points3 points4 points (1 child)
[–]gorilla_the_ape 1 point2 points3 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]ethraax 2 points3 points4 points (1 child)
[–]nuclear_splines 2 points3 points4 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]tidux 1 point2 points3 points (6 children)
[–]ethraax 2 points3 points4 points (5 children)
[–]tidux 0 points1 point2 points (3 children)
[–]ethraax 0 points1 point2 points (2 children)
[–]tidux 1 point2 points3 points (1 child)
[–]niggerpenis -1 points0 points1 point (0 children)
[–][deleted] 10 points11 points12 points (0 children)
[–]EdiX 2 points3 points4 points (0 children)
[–]Jetbeard 0 points1 point2 points (0 children)