Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Someone mentioned to me about making shell scripts and I wanted to read the ones on my distro (RH9).
As i attempt to shed some newbie skin i fin i'm typing find / -name ____ often and i'd like to write a script to speed up my learning while indulging my slackard ways.
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,634
Rep:
I think it would be easier to set an alias for this task (man alias). For writing bash scripts look at http://www.tldp.org/guides.html -- there is a guide called "Bash Guide for Beginners".
The '#' is to remind you to run these as root -- fewer errors & more access
Ignore all ":grep: ... No such file or directory" lines, they are going to stderr
RTfM on the things you don't understand here, it's a good opportunity to learn. less, grep, & awk are very useful tools, & I have deliberately not explained the options I used. (More chance for you to learn.)
Keep a good bash reference handy as you read the scripts.
If you want to look at other directories, change '/etc/*'.
EDIT: Broke long "Code" lines w/ '\\' to minimize horizontal scrolling. Be sure to re-assemble properly.
archtoad6,
thanks! i wont be able to try until later....
i tried to locate the script run from the 'more' command by using find / -name more, hoping this would lead me to the actual script and when i tried to open the 'script' with vi, as determined by the results of find, i got junk printed.
i guess the commands you posted somehow make the scripts into human language as opposed to the machine language these files are in.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.