Can someone help me understand why the following script works when it is set as an icon and clicked on in Rox, but cannot be run from an RXVT window?
(capitalized words are user variables)
-------------------------- start rdp.sh script ---------------------------
#!/bin/sh
rdesktop -u NAME -p PASSWORD -f SERVER
------------------------- end rdp.sh script -----------------------------
I would expect typing "rdp" in an RXVT window to launch the rdesktop program with the defined variables but instead I get this message:
bash: rdp: command not found
I have already applied the chmod a+x to the file rdp.sh and it shows up properly as permissions set to be executable. Permissions:
-rwxr-xr-x 1 64 Jan 13 10:50 rdp.sh
Thanks.
My script works from ROX, not from command line.Why?(SOLVED)
-
- Posts: 85
- Joined: Tue 07 Jun 2005, 06:32
- Location: Horsefly, Canada
- Contact:
My script works from ROX, not from command line.Why?(SOLVED)
Last edited by puppypilgrim on Fri 13 Jan 2006, 20:53, edited 1 time in total.
different to windows, you cannot type "myscript" instead of "myscript.bat".
So you must type "rdp.sh" or rename it to "rdp".
It also must be saved in one of the folders, that is in the $PATH.
On Puppy, use the folders
/usr/local/bin
or
/root/my-applications/bin
Another possibility:
Use "alias", for example
alias rdp=/root/teststuff/rdp.sh
Mark
So you must type "rdp.sh" or rename it to "rdp".
It also must be saved in one of the folders, that is in the $PATH.
On Puppy, use the folders
/usr/local/bin
or
/root/my-applications/bin
Another possibility:
Use "alias", for example
alias rdp=/root/teststuff/rdp.sh
Mark
Another important distinction is that in windows the current directory is the first one searched for the executable.
In Linux, the current directory is usually not in the search path. If you want to execute a script from the current directory you need to be explicit about that:
In Linux, the current directory is usually not in the search path. If you want to execute a script from the current directory you need to be explicit about that:
Code: Select all
# ./rdp.sh
-
- Posts: 85
- Joined: Tue 07 Jun 2005, 06:32
- Location: Horsefly, Canada
- Contact:
Wow. I would never have guessed the answer to that guys even though I have had Linux reference books from Slackware 5 and RedHat 5.
Perhaps if might be a good idea to have some fundamental differences between Windows\DOS and Linux compared side to side on a wiki or web page.
I am still transitioning from Windows to Linux and just love my Puppy! But find I am often alienated and frustrated trying to get up and running with Linux. Where I was once very proficient in Windows and the DOS prompt, I suddenly find myself in Linux kindergarten again!
Part of the journey, part of the journey.... Thanks for the help.
Perhaps if might be a good idea to have some fundamental differences between Windows\DOS and Linux compared side to side on a wiki or web page.
I am still transitioning from Windows to Linux and just love my Puppy! But find I am often alienated and frustrated trying to get up and running with Linux. Where I was once very proficient in Windows and the DOS prompt, I suddenly find myself in Linux kindergarten again!
Part of the journey, part of the journey.... Thanks for the help.
It is just a question of habit.
I started on Apple2/C64, then did some intensive years of Dos/Win.
Linux was "strange" in the beginning then, but now that I am used to it, I have problems with the Windows (cmd) -commands.
I even installed http://unxutils.sf.net , to feel not so desperate in win...
I started on Apple2/C64, then did some intensive years of Dos/Win.
Linux was "strange" in the beginning then, but now that I am used to it, I have problems with the Windows (cmd) -commands.
I even installed http://unxutils.sf.net , to feel not so desperate in win...
puppypilgrim,
Another way of dealing with your original question is to invoke the shell explicitly:
# bash rdp.sh
It sounds like you are going through the same agony I was going through a month or two ago, transitioning from the comfort of DOS/Windows to the alien Linux command line. The Puppy Forum and Wiki have some good resources to help you -- and please add the best ones you find!
The most important advice I have for you:
Find the best command-line tutorials and make yourself work through them, so that you learn most tricks without having to bash your head against a brick wall for hours first.
Find the best Linux-command wiki-type resource and keep refering to it for each thing you encounter.
http://wiki.linuxquestions.org/wiki/All_Commands
Here is one to consider:
http://www.unixguide.net/linux/linuxshortcuts.shtml
And try my wiki pages about ash/bash...
Another way of dealing with your original question is to invoke the shell explicitly:
# bash rdp.sh
It sounds like you are going through the same agony I was going through a month or two ago, transitioning from the comfort of DOS/Windows to the alien Linux command line. The Puppy Forum and Wiki have some good resources to help you -- and please add the best ones you find!
The most important advice I have for you:
Find the best command-line tutorials and make yourself work through them, so that you learn most tricks without having to bash your head against a brick wall for hours first.
Find the best Linux-command wiki-type resource and keep refering to it for each thing you encounter.
http://wiki.linuxquestions.org/wiki/All_Commands
Here is one to consider:
http://www.unixguide.net/linux/linuxshortcuts.shtml
And try my wiki pages about ash/bash...