bash/bin file wont executable, possible not the correct rights setup.
In previous post i had an issue with a bash file making..
I found a tutorial wich suggested me, to make a folder called "scripts" in the / folder (wich makes "scripts" located at /scripts and so i did, using sudo mkdir scripts... i also placed a script in it.. Code:
#!bin/bash wich should work... i get the following message.. Quote:
Code:
sudo chmod u+x rdesktop.sh Code:
ls -l rdesktop.sh Quote:
My question: how? Question2: the tutorial i found stated something in the line of Quote:
|
I think you are looking for "chown"---this is used to change the owner and/or group for a file.
"man chown" for details. The other issue I see is that you are putting an executable script into a new directory (/scripts). If you want to be able to run things here, then the directory needs to be added to your PATH variable. Otherwise, you would simply need to give the full path when calling the command. |
A few things.
Are you going to run rdesktop as root? You shouldn't. Run it as a regular user. Maybe you meant ~/scripts, and not /scripts. Your user scripts should reside in your $HOME directory, and not on any other place. There's no need to operate as root for this, and you should always operate with the minimal privileges that are necessary for a given task. Otherwise you are assuming an unnecessary risk. Note that, in your case, you are chmoding the script with u+x, which means +x to user, and user is root. So, no one else will be able to run it anyway, and as said, you shouldn't run such kind of apps as root. Another problem is your $PATH. /scripts is not a common location to search for executable files. So you need to add it to your path. To add a path globally you could use /etc/profile, or whatever mechanism your distro offers (that file might be changed without any notice the next time you upgrade bash). If you take my advice and decide to run it as a user, then you can add a path into ~/.bashrc and ~/.bash_profile (this all assumes that bash is your default shell). Code:
PATH="${PATH}:${HOME}/scripts/" |
ok, were can I place the scripts, to easy open it?
i can just insert, Code:
sudo chown medewerker /scripts // this gives ownership to user "medewerker" *edit* it seems to work... now all i gotta find out is to get it to autostart, yet if i just insert the full path to the script (its going to be the only script, as its going to work in a loop aka ubuntu-thinclient :) ) |
I just told you: put it in your home instead, and add the paths into the said files. Then, close bash and open it again so the .bashrc is sourced.
|
Quote:
The *normal* directories for executables are /usr/bin & /usr/local/bin. A lot of Slackware users (and I suspect other distros' users, as well) would put their self-made executables in /usr/local/bin. Generally, executables are put into some kind of *bin* directory... /usr/bin & /usr/local/bin are normally already in $PATH by default, so you wouldn't have to make any changes to $PATH. Also, you don't *necessarily* have to chmod u+x to make a script executable, unless you wish to restrict its execution to the file's owner, which can also be accomplished through file permissions. In other words, chmod +x should suffice. hth, |
Ok, well i did the chown in the folder, and the script works..
1 thing though... i found out it starts... yet system became inresponcive? could that be of the constantlooping? the comp is only a 500Mhz celeron 128MB + XFCE desktop |
OK---rdesktop is a utility to connect to a remote desktop--I don't know what the particular syntax is that you used. And what do you mean by "constantlooping"?
AND--what to you mean by "unresponsive"? What exactly is happening. |
Quote:
Code:
while [ 1 ];rdesktop -f -z sbc;done I just tried again now it just works like a charm :) I do have 1 more "problem" the pc I tested on has a BIOS, that is from 1999, and so i get the bios older then 2000 message and it states acpi=force, needs to be added, so i press esc when grub states me so, I add acpi=force at the end of the line press enter, and I see the Quote:
|
All times are GMT -5. The time now is 10:09 AM. |