Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | package Psh::Builtins::Source; |
2 | ||
3 | require Psh::Util; | |
4 | require Psh; | |
5 | ||
6 | =item * C<source FILE> [or C<. FILE>] | |
7 | ||
8 | Read and process the contents of the given file as a sequence of B<psh> | |
9 | commands. | |
10 | ||
11 | =cut | |
12 | ||
13 | sub bi_source | |
14 | { | |
15 | local $Psh::echo = 0; | |
16 | local $Psh::interactive= 0; | |
17 | foreach my $file (@{$_[1]}) { | |
18 | print "$file\n"; | |
19 | Psh::process_file(Psh::Util::abs_path($file)); | |
20 | } | |
21 | ||
22 | return (1,undef); | |
23 | } | |
24 | ||
25 | 1; |