Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jun 2007 11:14:41 +0100
From:      Alex Zbyslaw <xfb52@dial.pipex.com>
To:        Olivier Regnier <oregnier@oregnier.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: csh and echo syntax
Message-ID:  <46726691.1010309@dial.pipex.com>
In-Reply-To: <46724027.4070908@oregnier.net>
References:  <46724027.4070908@oregnier.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Olivier Regnier wrote:

> I'm running FreeBSD 6.2 and i use for the moment csh. When i test this 
> command in console
> echo -ne "/dev/da0s1\t /mnt/usb\t msdos\t rw,noauto\t 0\t 0" >> 
> /etc/fstab
>
> and with a cat /etc/fstab,
> i have this : -ne /dev/da0s1\t /mnt/usb\t msdos\t rw,noauto\t 0\t 0
>
> The \t is not supported with a echo in csh ? What happened ?

I'm not sure that any echo has ever supported special escape chars.  
Maybe it's some Gnu/Linuxism?  /bin/echo does the same as csh echo and 
the man page mentions no -e flag.

Try printf.

printf %b "/dev/da0s1\t /mnt/usb\t msdos\t rw,noauto\t 0\t 0"

Why aren't you adding a newline?  Do your command twice and you have a 
broken fstab :-(

printf %b "/dev/da0s1\t /mnt/usb\t msdos\t rw,noauto\t 0\t 0\n"

would, imho, be the right incantation.

--Alex




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?46726691.1010309>