[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: help
From: |
Sharuzzaman Ahmat Raslan |
Subject: |
Re: help |
Date: |
Wed, 5 Nov 2008 22:42:19 +0800 |
Hi Viscomi,
The character ; is used as command termination in Bash or other shell.
Commonly it is used to type 2 command in one line, but the command must
execute one after the other. For example.
address@hidden:~$ date; hostname
Rab Nov 5 22:38:25 MYT 2008
debian
The solution is to quote the ; character after the option -F. Example:
address@hidden:~$ cat CDI.txt
abc;def;ghi
jkl;mno;pqr
address@hidden:~$ awk -F; '{ print $1 }' CDI.txt
awk: option -F lacks argument
bash: { print $1 }: command not found
address@hidden:~$ awk -F";" '{ print $1 }' CDI.txt
abc
jkl
Happy scripting :)
On Wed, Nov 5, 2008 at 6:37 PM, francesco viscomi <address@hidden>wrote:
> Hi,
> I'm not an expert with awk (and gawk ) but i should want to be.
>
> I use this command:
> awk -F; '{ print $1 }' CDI.txt
>
> where the CDI.txt file is a test file where each field is separated by a ;
> And it do not work!!!!!
>
> If I change the separator field from ; to : it works well
>
>
> I use a windows machine (unfortunately!!!) on wich i have istalled Cygwin
> and use gawk from there.
>
>
> THANKS A LOT.
>
>
> --
> Ing. Viscomi Francesco
>
--
Sharuzzaman Ahmat Raslan
- help, francesco viscomi, 2008/11/05
- Re: help, Dave B, 2008/11/05
- Re: help,
Sharuzzaman Ahmat Raslan <=