Formatting of bootscripts

Archaic archaic at linuxfromscratch.org
Mon Jan 3 21:32:10 PST 2005


Forgive the horrible wrapping, but this is to demonstrate a problem I'm
having. The bootscripts are written with tabstop=2 which produces a nice
layout for anyone who uses tabstop=2. Everyone else, though, will see
the file differently. The standard tabstop is 8 and that is what vim is
set to here. Following is what the bootscripts look like here:


                                # Create stuff based on its type.
                                case "${type}" in
                                        dir)
                                                mkdir "${name}"
                                                ;;
                                        file)
                                                :> "${name}"
                                                ;;
                                        dev)
                                                case "${dtype}" in
                                                        char)
                                                                mknod "${name}" c ${maj} ${min}
                                                                ;;
                                                        block)
                                                                mknod "${name}" b ${maj} ${min}
                                                                ;;
                                                        pipe)
                                                                mknod "${name}" p
                                                                ;;
                                                        *)
                                                                boot_mesg -n "\nUnknown device type: ${dtype}" ${WARNING}
                                                                boot_mesg "" ${NORMAL}
                                                                ;;
                                                esac
                                                ;;
                                        *)
                                                boot_mesg -n "\nUnknown type: ${type}" ${WARNING}
                                                boot_mesg "" ${NORMAL}
                                                continue
                                                ;;
                                esac

############################################################################

And here is what the same snippet looks like to someone using a tabstop
of 2.

        # Create stuff based on its type.
        case "${type}" in
          dir)
            mkdir "${name}"
            ;;
          file)
            :> "${name}"
            ;;
          dev)
            case "${dtype}" in
              char)
                mknod "${name}" c ${maj} ${min}
                ;;
              block)
                mknod "${name}" b ${maj} ${min}
                ;;
              pipe)
                mknod "${name}" p
                ;;
              *)
                boot_mesg -n "\nUnknown device type: ${dtype}" ${WARNING}
                boot_mesg "" ${NORMAL}
                ;;
            esac
            ;;
          *)
            boot_mesg -n "\nUnknown type: ${type}" ${WARNING}
            boot_mesg "" ${NORMAL}
            continue
            ;;
        esac

This email is being sent to determine if the bootscripts should be laid
out with spaces instead of tabs so everyone sees the same thing. THe
only downside I can see is using the spacebar instead of the tab key. I
used to know the vim setting that allowed a person to use the tab key
and the file would be saved with spaces, not tabs. If anyone recalls
that setting, please reply.

Please voice your opinions, suggestions, etc.

-- 
Archaic

Power concedes nothing without a demand. It never did, and it never
will.  Find out just what people will submit to, and you have found out
the exact amount of injustice and wrong which will be imposed upon them;
and these will continue until they are resisted with either words or
blows, or with both.  The limits of tyrants are prescribed by the
endurance of those whom they oppress.

- Frederick Douglass, August 4, 1857




More information about the lfs-dev mailing list