bash file direct execution

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



>> This is something interesting. If I run 'ldd', it works.
>> Now I copied this script to the / directory and run it again with /ldd. 
>> That
>> works too.
>> Now I have transformed that file into my little echo script:
>> #!/bin/sh
>> echo testing
>>
>> And that works too. So I have now two files (/ldd and /ldd2) which are
>> scripts and which contains exactly the same content and which behaves
>> differently, from the same directory. One is done from scratch and the 
>> other
>> is modified from another working script.
>>
>> Again each file's contents:
>> #! /bin/sh
>> echo testing
>>
>> The result is the following when executed:
>> [root@box /]# ./ldd
>> testing
>> [root@box /]# ./ldd2
>> [root@box /]#
>
>That is unusual. What are you using to edit these files? I seem to
>recall one of my users having some weirdness with shell scripts
>because the lines weren't terminated properly.
>
>Compare the output from...
>
>$ cat -A /ldd
>$ cat -A /ldd2


Hello again, Will.

Good idea. Here is what those files are containing exactly:
[root@box /]# cat -A /ldd
#! /bin/sh$
echo testing$
$
[root@box /]# cat -A /ldd2
#! /bin/sh$
echo testing$
$
[root@box /]#

They seem exactly the same..
BTW now, for any reason, I can create a new file in the / directory and run 
it properly (before it always didn't output anything). However by creating 
that in the /home directory it won't work, like before in /.

Regards,
Daniel




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux