I didn't think that it would matter, but in case it does... 32bit mint10 gnome?
I use Mint 9 (LTS) Gnome.
I have no idea what you did there, but I copied and pasted as you said with the same result as all the others.
Humor me for a moment, you copied and pasted everything
literally? You do realize the ellipses (...) at the bottom of the code fragment is meant for you to put the
actual commands there. I'm not trying to be patronizing, but everyone knows how prone to misinterpretation the English language is.
Code: Select all
#!/bin/sh
# Make sure the script is running in a terminal window
tty -s
SUCCESS=$?
if [ $SUCCESS -ne 0 ]
then
gnome-terminal --command=$0
exit
fi
# Put the rest of your script after this line
ifconfig wlan1 up
wait
ifconfig
wait
cd /home/user/documents
ls
read -p "Press the enter key..." DUMMY
Save the above script in a file and enable the necessary permissions. Run the script inside a terminal window. You should see some output. Run again the script from Nautilus. It should open a terminal window and you should see the same output. If the read command doesn't work, change the shebang line from #!/bin/sh to #!/bin/bash and try again. If you still don't see any kind of output then I do not know why. Probably it's the difference between Mint 9 and 10, but I can't fathom that is the bottom-line reason.
Now, as far as executed commands not giving you any feedback, that's not uncommon. It is normal and standard convention that if a command does not return any message, then the command ran successfully. It will only provide feedback when necessary, such as if there was an error or it needs to provide output based on what was requested.
If you still want some feedback regardless if a command ran successfully or not, then it is possible. Apart from the set -x command mentioned earlier, there are at least two other ways:
(1) Depending on the command, you can add the -v switch. -v means verbose output, i.e. it will provide feedback as to what is going on. Not all commands support this switch, though. You will have to consult the man pages to find out. E.g.:
Code: Select all
administrator@dg31pr ~ $ mkdir $HOME/no-feedback
administrator@dg31pr ~ $ mkdir -v $HOME/with-feedback
mkdir: created directory `/home/administrator/with-feedback'
administrator@dg31pr ~ $
(2) Commands also generate what is called an exit code. If the command runs successfully, it exits passing the value 0 (zero) to a special variable $?. Non-zero values usually means -- you've guessed it -- errors or some other issue. As always, read up the man page for the particular command to find what exit code it generates. The following code fragment demonstrates how it's used:
Code: Select all
#!/bin/sh
# The following will succeed
mkdir $HOME/this-is-allowed
SUCCESS=$?
if [ $SUCCESS -eq 0 ]
then
echo "mkdir successful" # <-- this will show on screen
else
echo "mkdir unsuccessful"
fi
# Whereas the following will fail. You can't create a directory
# from the root folder (/) without the necessary privileges.
mkdir /this-is-not-allowed
SUCCESS=$?
if [ $SUCCESS -eq 0 ]
then
echo "mkdir successful"
else
echo "mkdir unsuccessful" # <-- this will show after mkdir error message
fi
HTH.