* [gentoo-user] OT: bash details
@ 2005-08-12 14:25 James
2005-08-12 14:33 ` Frank Schafer
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: James @ 2005-08-12 14:25 UTC (permalink / raw
To: gentoo-user
Hello,
I cannot seem to find detailed document/manual on using bash robustly
in a programming environment. Maybe I need to purchase a good book?
Mostly I'm an old csh hack. I like bash, but it seems porting over C code
from a csh (or embedded) to a bash environment gives me trouble that is mostly
due to my lack of in-depth knowledge of bash. Simple things like paths
to libraries and other software modules inside of the ported code I
either screw up or it seems like I solve the problems differently each
time.
Often the code I'm porting was not written for any type of unix
or pre-emptible kernel, so I have features and functions that are
instantiated in assembler or ansi C, that I have to figure out
if there is a library I can use (acceptable similarity) or if
I need to port the native micro code to a linux module or library.
I seem to get these things to eventually work, but, well, I feel stupid
and inept, as I should not be having the difficulty with these
efforts that I am experiencing. Productivity must increase, and the
only thing I can figure out, is I need to read and learn from a document
or somebody that has figured out more 'rote methodologies' that I do
not posess (if this sounds confusing, it's because I frustrated
and not sure what I'm missing or deficient in).
Any suggestions and examples where I may read and look at examples
or a suitable forum to ask questions would be appreciated. Bash trickery
is definately a weak point for me, but, that may not be my only
area where I need to improve my knowledge and skills, related to
software porting and development. Most of my code does involve hardware
and or device drivers. Things like embeding code into the
kernel or a module, thus avoiding bash all together with the 'driver'
portion of the (hardware) code, and then making the other part of the
code user accessible, via a shell. Some robust, detailed examples
would be keen. I'm sufficient at getting chips and device drivers
working in a micro environment, it's making these hardware and software
items accessible via the (linux) shell environment where I struggle the most.
James
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] OT: bash details
2005-08-12 14:25 [gentoo-user] OT: bash details James
@ 2005-08-12 14:33 ` Frank Schafer
2005-08-12 15:01 ` [gentoo-user] " James
2005-08-12 14:37 ` [gentoo-user] " Matthew Cline
2005-08-12 14:53 ` Ciaran McCreesh
2 siblings, 1 reply; 9+ messages in thread
From: Frank Schafer @ 2005-08-12 14:33 UTC (permalink / raw
To: gentoo-user
Hi,
Gooooooooooogle "Advanced Bash-Scripting Guide" >>>
<www.tldp.org/LDP/abs/html/>
Regards
Frank
On Fri, 2005-08-12 at 14:25 +0000, James wrote:
> Hello,
>
> I cannot seem to find detailed document/manual on using bash robustly
> in a programming environment. Maybe I need to purchase a good book?
> Mostly I'm an old csh hack. I like bash, but it seems porting over C code
> from a csh (or embedded) to a bash environment gives me trouble that is mostly
> due to my lack of in-depth knowledge of bash. Simple things like paths
> to libraries and other software modules inside of the ported code I
> either screw up or it seems like I solve the problems differently each
> time.
>
> Often the code I'm porting was not written for any type of unix
> or pre-emptible kernel, so I have features and functions that are
> instantiated in assembler or ansi C, that I have to figure out
> if there is a library I can use (acceptable similarity) or if
> I need to port the native micro code to a linux module or library.
> I seem to get these things to eventually work, but, well, I feel stupid
> and inept, as I should not be having the difficulty with these
> efforts that I am experiencing. Productivity must increase, and the
> only thing I can figure out, is I need to read and learn from a document
> or somebody that has figured out more 'rote methodologies' that I do
> not posess (if this sounds confusing, it's because I frustrated
> and not sure what I'm missing or deficient in).
>
> Any suggestions and examples where I may read and look at examples
> or a suitable forum to ask questions would be appreciated. Bash trickery
> is definately a weak point for me, but, that may not be my only
> area where I need to improve my knowledge and skills, related to
> software porting and development. Most of my code does involve hardware
> and or device drivers. Things like embeding code into the
> kernel or a module, thus avoiding bash all together with the 'driver'
> portion of the (hardware) code, and then making the other part of the
> code user accessible, via a shell. Some robust, detailed examples
> would be keen. I'm sufficient at getting chips and device drivers
> working in a micro environment, it's making these hardware and software
> items accessible via the (linux) shell environment where I struggle the most.
>
>
>
> James
>
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] OT: bash details
2005-08-12 14:25 [gentoo-user] OT: bash details James
2005-08-12 14:33 ` Frank Schafer
@ 2005-08-12 14:37 ` Matthew Cline
2005-08-12 14:53 ` Ciaran McCreesh
2 siblings, 0 replies; 9+ messages in thread
From: Matthew Cline @ 2005-08-12 14:37 UTC (permalink / raw
To: gentoo-user
On 8/12/05, James <wireless@tampabay.rr.com> wrote:
> Hello,
>
> I cannot seem to find detailed document/manual on using bash robustly
> in a programming environment.
Let me be the first of many to point you to the Advanced Bash Scripting Guide:
http://www.tldp.org/LDP/abs/html/
HTH,
Matt
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] OT: bash details
2005-08-12 14:25 [gentoo-user] OT: bash details James
2005-08-12 14:33 ` Frank Schafer
2005-08-12 14:37 ` [gentoo-user] " Matthew Cline
@ 2005-08-12 14:53 ` Ciaran McCreesh
2 siblings, 0 replies; 9+ messages in thread
From: Ciaran McCreesh @ 2005-08-12 14:53 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 716 bytes --]
On Fri, 12 Aug 2005 14:25:40 +0000 (UTC) James
<wireless@tampabay.rr.com> wrote:
| I cannot seem to find detailed document/manual on using bash robustly
| in a programming environment. Maybe I need to purchase a good book?
Mostly you need to familiarise yourself with 'man bash'. There's the
"Advanced Bash Scripting Guide", but it's neither advanced nor
particularly good. The devmanual [1] has a fair bit of related
information, but it mostly focuses upon the ebuild environment.
[1]: http://dev.gentoo.org/~plasmaroo/devmanual/
--
Ciaran McCreesh : Gentoo Developer (Vim, Shell tools, Fluxbox, Cron)
Mail : ciaranm at gentoo.org
Web : http://dev.gentoo.org/~ciaranm
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* [gentoo-user] Re: OT: bash details
2005-08-12 14:33 ` Frank Schafer
@ 2005-08-12 15:01 ` James
2005-08-12 15:26 ` Ciaran McCreesh
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: James @ 2005-08-12 15:01 UTC (permalink / raw
To: gentoo-user
Frank Schafer <frank.schafer <at> t-systems.cz> writes:
> Gooooooooooogle "Advanced Bash-Scripting Guide" >>>
> <www.tldp.org/LDP/abs/html/>
Well this is an excellent resource, BUT it seems
devoid of any examples where a custom device driver,
say for the serial port on a linux system,
inserted as a module or is part of the kernel,
and the associate software that allows users
to access some of the hardware(features) and not
other hardware/firmware/kernel features(code), unless
they are root, or have a special (encrypted)key
or another form of chicanery (biometric generated
key).
Still a nice resource.
Thanks,
James
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Re: OT: bash details
2005-08-12 15:01 ` [gentoo-user] " James
@ 2005-08-12 15:26 ` Ciaran McCreesh
2005-08-12 16:02 ` Uwe Thiem
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Ciaran McCreesh @ 2005-08-12 15:26 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]
On Fri, 12 Aug 2005 15:01:09 +0000 (UTC) James
<wireless@tampabay.rr.com> wrote:
| Frank Schafer <frank.schafer <at> t-systems.cz> writes:
|
| > Gooooooooooogle "Advanced Bash-Scripting Guide" >>>
| > <www.tldp.org/LDP/abs/html/>
|
| Well this is an excellent resource, BUT it seems
| devoid of any examples where a custom device driver,
| say for the serial port on a linux system,
| inserted as a module or is part of the kernel,
| and the associate software that allows users
| to access some of the hardware(features) and not
| other hardware/firmware/kernel features(code), unless
| they are root, or have a special (encrypted)key
| or another form of chicanery (biometric generated
| key).
Yup. It also lacks an example showing how you can make a mysql-driven
ecommerce website which sells books to preschool children who have
credit cards.
--
Ciaran McCreesh : Gentoo Developer (Vim, Shell tools, Fluxbox, Cron)
Mail : ciaranm at gentoo.org
Web : http://dev.gentoo.org/~ciaranm
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Re: OT: bash details
2005-08-12 15:01 ` [gentoo-user] " James
2005-08-12 15:26 ` Ciaran McCreesh
@ 2005-08-12 16:02 ` Uwe Thiem
2005-08-12 22:09 ` Nick Rout
2005-08-15 13:19 ` Marco Matthies
3 siblings, 0 replies; 9+ messages in thread
From: Uwe Thiem @ 2005-08-12 16:02 UTC (permalink / raw
To: gentoo-user
On 12 August 2005 16:01, James wrote:
> Frank Schafer <frank.schafer <at> t-systems.cz> writes:
> > Gooooooooooogle "Advanced Bash-Scripting Guide" >>>
> > <www.tldp.org/LDP/abs/html/>
>
> Well this is an excellent resource, BUT it seems
> devoid of any examples where a custom device driver,
> say for the serial port on a linux system,
> inserted as a module or is part of the kernel,
> and the associate software that allows users
> to access some of the hardware(features) and not
> other hardware/firmware/kernel features(code), unless
> they are root, or have a special (encrypted)key
> or another form of chicanery (biometric generated
> key).
True but then, what you are asking for has precious little to do with bash
scripting. I was actually wondering what you need when reading your original
code.
If you want to hack kernel drivers you need to familiarise yourself with the
kernel and the generic driver interface. Don't know whether the documentation
in the kernel is enough for that.
On the other hand, I don't think you really need a kernel driver. If your goal
is to drive some gadget attached to a serial port, you can do all that in a
userspace application. I once wrote the complete interface between a database
and an array of automatic medical analysers attached to a serial line in
userspace. Alright, that was on HPUX but it did compile and work under linux
as well.
Although a bit outdated, Richard Stevens's "Advanced Programming in the UNIX
Environment" is still a very valuable resource to get started.
Uwe
--
95% of all programmers rate themselves among the top 5% of all software
developers. - Linus Torvalds
http://www.uwix.iway.na (last updated: 20.06.2004)
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Re: OT: bash details
2005-08-12 15:01 ` [gentoo-user] " James
2005-08-12 15:26 ` Ciaran McCreesh
2005-08-12 16:02 ` Uwe Thiem
@ 2005-08-12 22:09 ` Nick Rout
2005-08-15 13:19 ` Marco Matthies
3 siblings, 0 replies; 9+ messages in thread
From: Nick Rout @ 2005-08-12 22:09 UTC (permalink / raw
To: gentoo-user
On Fri, 2005-08-12 at 15:01 +0000, James wrote:
> Frank Schafer <frank.schafer <at> t-systems.cz> writes:
>
>
> > Gooooooooooogle "Advanced Bash-Scripting Guide" >>>
> > <www.tldp.org/LDP/abs/html/>
>
> Well this is an excellent resource, BUT it seems
> devoid of any examples where a custom device driver,
> say for the serial port on a linux system,
> inserted as a module or is part of the kernel,
> and the associate software that allows users
> to access some of the hardware(features) and not
> other hardware/firmware/kernel features(code), unless
> they are root, or have a special (encrypted)key
> or another form of chicanery (biometric generated
> key).
and what has the above possibly got to do with bash?
>
> Still a nice resource.
>
> Thanks,
> James
>
--
Nick Rout <nick@rout.co.nz>
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Re: OT: bash details
2005-08-12 15:01 ` [gentoo-user] " James
` (2 preceding siblings ...)
2005-08-12 22:09 ` Nick Rout
@ 2005-08-15 13:19 ` Marco Matthies
3 siblings, 0 replies; 9+ messages in thread
From: Marco Matthies @ 2005-08-15 13:19 UTC (permalink / raw
To: gentoo-user
> Well this is an excellent resource, BUT it seems
> devoid of any examples where a custom device driver,
> say for the serial port on a linux system,
> inserted as a module or is part of the kernel,
> and the associate software that allows users
> to access some of the hardware(features) and not
> other hardware/firmware/kernel features(code), unless
> they are root, or have a special (encrypted)key
> or another form of chicanery (biometric generated
> key).
If you are interested in device drivers and kernel stuff on linux, you
might want to check out these fine books:
Linux Device Drivers, 3rd ed. (available online)
http://lwn.net/Kernel/LDD3/
Linux Kernel Development 2nd ed.
http://rlove.org/kernel_book/
Marco
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2005-08-15 13:23 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-12 14:25 [gentoo-user] OT: bash details James
2005-08-12 14:33 ` Frank Schafer
2005-08-12 15:01 ` [gentoo-user] " James
2005-08-12 15:26 ` Ciaran McCreesh
2005-08-12 16:02 ` Uwe Thiem
2005-08-12 22:09 ` Nick Rout
2005-08-15 13:19 ` Marco Matthies
2005-08-12 14:37 ` [gentoo-user] " Matthew Cline
2005-08-12 14:53 ` Ciaran McCreesh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox