1 |
Walter Dnes writes: |
2 |
|
3 |
> This message is coming from my 32-bit "hot backup" gentoo machine. |
4 |
> For some reason, any script that I call on my 64-bit machine immediately |
5 |
> returns to the command prompt. No warnings or error messages or |
6 |
> diagnostics. Builtins and compiled executables work OK. For instance, |
7 |
> if I have a script named "xyz" that goes like so... |
8 |
> |
9 |
> #!/bin/bash |
10 |
> man bash |
11 |
> |
12 |
> ..., executing "xyz" or "~/bin/xyz" results in bash immediately |
13 |
> returning to to the command prompt. |
14 |
|
15 |
Weeeeird. I have no idea. The usual guess is that a partition is mounted |
16 |
noexec, but that would give an error. Or that the script is saved in DOS |
17 |
format, with CR-LF instead of LF endings, but that would throw a 'bad |
18 |
interpeter' error. |
19 |
|
20 |
Try 'strace ~/bin/xyz' (emerge strace if you don't have it) and compare the |
21 |
output with your working machine, that should give some hints to what is |
22 |
happening. |
23 |
|
24 |
What happens if you change the script to this? |
25 |
|
26 |
#!/usr/bin/man bash |
27 |
|
28 |
Oh, now I _do_ have an idea. What about startup files, like .bashrc, |
29 |
.bash_profile and such? Any recent chanegs here? Try: |
30 |
|
31 |
#!/bin/bash -i |
32 |
|
33 |
This forces the shell to be interactive, so it sources other startup files. |
34 |
Add 'xv' (bash -ixv) to let bash output which lines are being executed. |
35 |
Also put some debug info in .bashrc, .bash_profile, /etc/bash/bashrc, |
36 |
/etc/profile to see what of them is being started. |
37 |
|
38 |
And try another user without your personal startup files. Same effect? |
39 |
|
40 |
Wonko |