PDA

View Full Version : bash help needed :(


haiawa
01-22-2004, 08:58 PM
hello, i'm learning bash scripting, but i can't do anything, don't have constant net access, don't know any good books, i want only write very simple script and i wonder i somebody could help me: i want to display all the files in folder /etc that i can read, i mean i want to display their names and two numbers next to each of them: their number of lines, and number of lines that NOT start with "#". PLEASE tell me how to do it just this one time, i won't manage it by myself, thanks, Barti, Poland

valan
08-05-2004, 02:38 PM
tldp.org is your friend. In particular, check out the Bash Guide for Beginners (http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html), Advanced Bash Scripting Guide (http://tldp.org/LDP/abs/html/index.html), and the Bash Programming Intro HOWTO (http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html). Also check the info page for bash. Those four sources are more than enough to tell you how to do anything with bash.

Whiteknight
08-05-2004, 04:59 PM
i feel like this would be much easier with another language (perl in particular would handle this job in a meer matter of lines), but you asked for bash, and we will give you bash.

valan was right with those links above, they will get you going in the right direction. if you need more help after that we could walk you through a solution or two (assuming we here can find a good one).

good luck.

sirclif
04-07-2005, 05:09 PM
do you just want to use bash builtin commands and variables, or could you use commands like sed or wc to help?