FedoraThis forum is for the discussion of the Fedora Project.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
all of your questions are actually illogical or irrelevant, if i'm understanding the 2nd one right in the first place...
1) you can put a script *anywhere* there is no special location.
2) you mean the $ sign? no, that is just an example command prompt. it is used in code to clarify exactly how to run a program.
3) this is not windows, files are recognized by what they actaully are, not what characters just so happen to be on the end of it. the use of .sh is a handy visual convention, but absolutely non essential
i guess you're just asking how to make a script exectuable? run "chmod +x scriptname" and then you canjust run the script as if it were a binary executable.
The location and name of the file are not important. The location is usually in a bin directory. On your userid, in ~/bin/ which should be in your default PATH:
echo $PATH
The file extension is not used on Linux, it's is strictly for your information. The executable could be called 'linuxnoob.sh', 'linuxnoob.xyz' or just 'linuxnoob' - it doesn't make any difference.
To make a shell script executable, two things are needed:
1. The script must start with #! followed by the full path to the shell interpreter. For example:
#!/bin/bash
2. The executable flag must be set on the file. For example:
well you've got to be in the right directory to reach the file... or use an absolute or relative file path e.g. /home/user/script or ../user/script etc...
If the file 'script' is not in the current directory, then you must either cd to the correct directory, or specify the path. For example, if 'script is in the '~/bin/' directory, you can either:
Distribution: Fedora core 5 Ubuntu 6 Slackware 11(if and when I get it running)
Posts: 151
Original Poster
Rep:
Oh thanks for the help. I will read those and start using my other name.
If for instance i had someof my poetry on root in fileA and someof my school assignments in fileB is there anyway I can make those files viewable for other users, which consequently is me and myself hehe.
Where, of course, you need to replace everything in angle brackets (including the brackets) by the actual names you use.
See man mv and man chown for details.
Also, note that info --apropos <keywords> and man -K <keywords> will search the on-line documentation for any command whose description uses that keyword. (And, of course, info info and man man will give you details about the info and man commands.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.