Skip to contentSkip to conversation

trivial question about script

DISCUSSION ramzez 2 participants 2 messages Feb 9, 2003

lore
Share & tools
lore

ramzez

author
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi friends...
How do I can output each fiel below other in his column? I mean; when use
somethin like: "cat /etc/fstab | awk '{print $1"\t\t\t"$2"\t\t\t"$3}'" y recieve this output:
- ----real output -------------
LABEL=/ / ext3
LABEL=/boot /boot ext3

none                    /dev/pts                        devpts
none                    /proc                   proc
none                    /dev/shm                        tmpfs
/dev/hda5                       swap                    swap
/dev/cdrom                      /mnt/cdrom                      iso9660
/dev/cdrom1                     /mnt/cdrom1                     iso9660
/dev/fd0                        /mnt/floppy                     auto

- -----end ------------------------------------
But I hope to receive like this:
- ---desired output ------------------
LABEL=/ / ext3
LABEL=/boot /boot ext3

none                     /dev/pts             devpts
none                     /proc                 proc
none                     /dev/shm            tmpfs

/dev/hda5 swap swap
/dev/cdrom /mnt/cdrom iso9660
/dev/cdrom1 /mnt/cdrom1 iso9660
/dev/fd0 /mnt/floppy auto
- --
Linux User Registered #232544
my GnuPG-key at www.keyserver.net

    --- rm -rf /bin/laden ---

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+RjxxG3Fqyap52TERAmzoAJ9RN/1azFmLKOLseWCKwpNxRFRR7ACgk5Ng c6zSQi6FYhCYVD8gnLaOf40=
=TNbP
-----END PGP SIGNATURE-----

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#1 lore raw
Quoted 19 lines · ramzez

Hi friends...
How do I can output each fiel below other in his column? I mean; when use
somethin like: "cat /etc/fstab | awk '{print $1"\t\t\t"$2"\t\t\t"$3}'" y recieve this output:
- ----real output -------------
LABEL=/ / ext3
LABEL=/boot /boot ext3

none                    /dev/pts                        devpts
none                    /proc                   proc
none                    /dev/shm                        tmpfs
/dev/hda5                       swap                    swap
/dev/cdrom                      /mnt/cdrom                      iso9660
/dev/cdrom1                     /mnt/cdrom1                     iso9660
/dev/fd0                        /mnt/floppy                     auto

- -----end ------------------------------------
But I hope to receive like this:
- ---desired output ------------------
LABEL=/ / ext3
LABEL=/boot /boot ext3

Quoted 7 lines
none                     /dev/pts             devpts
none                     /proc                 proc
none                     /dev/shm            tmpfs

/dev/hda5 swap swap
/dev/cdrom /mnt/cdrom iso9660
/dev/cdrom1 /mnt/cdrom1 iso9660
/dev/fd0 /mnt/floppy auto

Does the following work, does here.

cat /etc/fstab | awk '{print $1"\t"$2"\t"$3}'
If not it must be due to tabs in the file itself.

Signature · 9 lines
Regards Richard
[email protected]
http://people.zeelandnet.nl/pa3gcu/

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs