simple shell script

#!/bin/bash
echo hallo world

this very simple shell-script will not work. chmod 777 was set. logging in as superuser changed nothing. I am using openSuse-11 beta. Within a quickly installed Ubuntu-Linux this script works.
Has someone any idea?
thanks
Reinhold

Can you tell us what you mean by “It would not work”? Are there any errors? Does it just not do anything? How are you invoking it? This works for me:

$ cat >etest
#!/bin/bash
echo Hello World
^D
$ chmod 777 etest
$ ./etest
Hello World

for me it works fine too:

echo echo hello world > test;chmod 750 test;./test

stefan

thanks for the answers.

I used a second file for the script and everything works fine. But now to the real problem:

I compiled a shared library and a main with g++. Both were developed under Windows. Compilation was ok. But when starting the main, I got the error
main: error while loading shared libraries … no such file
someone told me to use following script. The script now works, but the library error goes on.

has someone any idea

#!/bin/bash
echo Hello World
cp main main.bak
cat main.bak | sed “s/export LD_ASSUME_KERNEL/#xport LD_ASSUME_KERNEL/” > main
./main

btw you do not need the cat:

#!/bin/bash
echo Hello World
cp main main.bak 
sed "s/export LD_ASSUME_KERNEL/#xport LD_ASSUME_KERNEL/" main.bak > main
./main

I do not see what the added value of the **echo **is to the script.

I suppose this script does anyhow do something because it consists of legal constructs. But as you do not tell what your intention is, I can not know what is wrong or right with it. As I see it it will change all occurencies of “export LD_ASSUME_KERNEL” into “#xport LD_ASSUME_KERNEL” in the file main. It also creates a file main.bak with the original contents of main.
Now when this was that you think it should do, your script seems OK to me.

Youir real problem seems to be with the program main. But not with this script.

hi,
i found an apropriate tutorial.
everything works now
thanks

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Care to share?

Good luck.

TrollSoft wrote:
| hi,
| i found an apropriate tutorial.
| everything works now
| thanks
|
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIY6t43s42bA80+9kRAqXzAJ9R/WdgNnvGw7OAzixFhKZM+O95QgCaAghN
kVpYBm7Kl7FEeu5f5nFd314=
=GWhB
-----END PGP SIGNATURE-----