how to proceed with chapter 7 concerning cat > output << EOF

Rod Roark rod at sunsetsystems.com
Thu Nov 2 08:34:52 PST 2000


I think you're worrying too much about trying to make the book do 
everything.  Books are for reading.  Everything else is downloaded, 
why not also a tarball of the initial directory structure along with 
all of the scripts and configuration files from the book?

I've already made such a tarball for LFSMake.  See 
http://www.sunsetsystems.com/lfsmake/lfs-skeleton-1.1.tar.gz.
Feel free to copy and massage it for LFS.

Hey by the way, congratulations on the great response from your
freshmeat announcement!

-- Rod
   http://www.sunsetsystems.com/

On Thu, 02 Nov 2000, Gerard Beekmans wrote:
> Hi,
> 
> If we want to create all files in the book using cat > output << EOF 
> constructions we have a little problem in chapter 7 - the boot scripts.
> 
> Take the first few lines from the rc script:
> 
> source /etc/init.d/functions
> 
> print_error_msg()
> {
> 
>         echo
>         $FAILURE
> <cut>
> 
> if we do that in a cat > rc << EOF it will not work properly due to the $ and 
> in other files the commands includes in ` like kill -9 `cat /var/run/$1.pid`
> 
> If you enter them literally, bash will try to execute those. So we have to 
> escape them. The book will then contain:
> 
> cat > rc << EOF
> 
> <cut>
> 
> print_error_msg()
> {
> 
>         echo
>         \$FAILURE
> <cut>
> EOF
> 
> Now $FAILURE will be put in the rc file. But if people choose not to use the 
> cat command but just copy&paste the content into a file, those backslashes 
> will become a problem.
> 
> So we either can't use the content in the book in a cat > out << EOF 
> construction and you have copy&paste into vim, or you can do a cat but you 
> cannot copy&paste into vim.
> 
> Although I would much prefer the cat option personally, not everybody will be 
> happy with it.
> 
> A solution could be to create yet another appendix and put the plain scripts 
> in there without escape sequences (backslashes). Or tell the readers to 
> download the scripts if they don't want to use the 'cat' construction, but i 
> rather not do that because it's very limiting.
> 
> Opinions and/or alternatives are very welcome
> 
> -- 
> Gerard Beekmans
> www.linuxfromscratch.org

-- 
Unsubscribe: send email to lfs-discuss-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message




More information about the lfs-dev mailing list