Can anyone tell me what's wrong with this command?
C:\Users\Owner>gawk "BEGIN { FS = , }"
gawk: cmd. line:1: BEGIN { FS = , }
gawk: cmd. line:1: ^ parse error
|
|
0
|
|
|
|
Reply
|
Owner
|
4/12/2010 3:43:11 PM |
|
Owner said the following on 4/12/2010 10:43 AM:
> Can anyone tell me what's wrong with this command?
>
> C:\Users\Owner>gawk "BEGIN { FS = , }"
> gawk: cmd. line:1: BEGIN { FS = , }
> gawk: cmd. line:1: ^ parse error
>
>
The comma needs to be in quotes:
"BEGIN { FS = \",\" }"
--
(^\pop/^)
I'm lost... I've gone to look for myself.
If I should return before I get back, keep me here.
--
|
|
0
|
|
|
|
Reply
|
pop
|
4/12/2010 4:13:14 PM
|
|
Owner schrieb:
> Can anyone tell me what's wrong with this command?
>
> C:\Users\Owner>gawk "BEGIN { FS = , }"
You use the wrong OS.
But more seriously; strings need to be quoted as in (Note: this is Unix
shell syntax)
gawk 'BEGIN { FS = "," }'
Problem is that on your OS you seem to need using double quotes to embed
the awk program, which probably forces you to escape all double quotes
that appear around any strings in the awk program, probably
gawk "BEGIN { FS = \",\" }"
or you have to put your awk code in a file, say a_file, and call if as
gawk -f a_file
where you avoided the quoting issue on your OS. Another option in this
specific case is that you use an awk command line option to set the
variable FS;
gawk -F, "..."
Again, the comma might need some escaping/quoting on your OS.
Janis
> gawk: cmd. line:1: BEGIN { FS = , }
> gawk: cmd. line:1: ^ parse error
>
>
|
|
0
|
|
|
|
Reply
|
Janis
|
4/12/2010 4:19:52 PM
|
|
In article <hpvgr0$p5q$1@pop.motzarella.org>, pop <p_o_p@hotmail.com> wrote:
>Owner said the following on 4/12/2010 10:43 AM:
>> Can anyone tell me what's wrong with this command?
>>
>> C:\Users\Owner>gawk "BEGIN { FS = , }"
>> gawk: cmd. line:1: BEGIN { FS = , }
>> gawk: cmd. line:1: ^ parse error
>>
>>
>The comma needs to be in quotes:
>"BEGIN { FS = \",\" }"
True, but it is unlikely that the backslashes are right, since this
looks like DOS/Windows and backslashes aren't special in the commonly
available DOS/Windows shell(s) [COMMAND.COM and CMD.EXE].
I think that what OP was really looking for was:
C:\Users\Owner>gawk -F, ...
Note the lack of need for quoting.
--
(This discussion group is about C, ...)
Wrong. It is only OCCASIONALLY a discussion group
about C; mostly, like most "discussion" groups, it is
off-topic Rorsharch revelations of the childhood
traumas of the participants...
|
|
0
|
|
|
|
Reply
|
gazelle
|
4/12/2010 4:21:18 PM
|
|
Kenny McCormack said the following on 4/12/2010 11:21 AM:
> In article<hpvgr0$p5q$1@pop.motzarella.org>, pop<p_o_p@hotmail.com> wrote:
>> Owner said the following on 4/12/2010 10:43 AM:
>>> Can anyone tell me what's wrong with this command?
>>>
>>> C:\Users\Owner>gawk "BEGIN { FS = , }"
>>> gawk: cmd. line:1: BEGIN { FS = , }
>>> gawk: cmd. line:1: ^ parse error
>>>
>>>
>> The comma needs to be in quotes:
>> "BEGIN { FS = \",\" }"
>
> True, but it is unlikely that the backslashes are right, since this
> looks like DOS/Windows and backslashes aren't special in the commonly
> available DOS/Windows shell(s) [COMMAND.COM and CMD.EXE].
>
> I think that what OP was really looking for was:
>
> C:\Users\Owner>gawk -F, ...
>
> Note the lack of need for quoting.
>
Partially true: backslashes won't work if the FS string contains a
special character to windows. Otherwise, the backslashes are special to
gawk since the entire string in windows is passed to gawk including all
quotes (command.com and cmd.exe does not remove quotes but only ingnores
what is between them)
--
(^\pop/^)
I'm lost... I've gone to look for myself.
If I should return before I get back, keep me here.
--
|
|
0
|
|
|
|
Reply
|
pop
|
4/12/2010 4:31:29 PM
|
|
pop said the following on 4/12/2010 11:31 AM:
> Kenny McCormack said the following on 4/12/2010 11:21 AM:
>> In article<hpvgr0$p5q$1@pop.motzarella.org>, pop<p_o_p@hotmail.com>
>> wrote:
>>> Owner said the following on 4/12/2010 10:43 AM:
>>>> Can anyone tell me what's wrong with this command?
>>>>
>>>> C:\Users\Owner>gawk "BEGIN { FS = , }"
>>>> gawk: cmd. line:1: BEGIN { FS = , }
>>>> gawk: cmd. line:1: ^ parse error
>>>>
>>>>
>>> The comma needs to be in quotes:
>>> "BEGIN { FS = \",\" }"
>>
>> True, but it is unlikely that the backslashes are right, since this
>> looks like DOS/Windows and backslashes aren't special in the commonly
>> available DOS/Windows shell(s) [COMMAND.COM and CMD.EXE].
>>
>> I think that what OP was really looking for was:
>>
>> C:\Users\Owner>gawk -F, ...
>>
>> Note the lack of need for quoting.
>>
> Partially true: backslashes won't work if the FS string contains a
> special character to windows. Otherwise, the backslashes are special to
> gawk since the entire string in windows is passed to gawk including all
> quotes (command.com and cmd.exe does not remove quotes but only ingnores
what is between them) <-with certain exceptions such as expanding env.
vars in %s
--
(^\pop/^)
I'm lost... I've gone to look for myself.
If I should return before I get back, keep me here.
--
|
|
0
|
|
|
|
Reply
|
pop
|
4/12/2010 4:34:55 PM
|
|
In article <hpvht7$2fk$1@pop.motzarella.org>, pop <p_o_p@hotmail.com> wrote:
....
>> True, but it is unlikely that the backslashes are right, since this
>> looks like DOS/Windows and backslashes aren't special in the commonly
>> available DOS/Windows shell(s) [COMMAND.COM and CMD.EXE].
....
>Partially true: backslashes won't work if the FS string contains a
>special character to windows. Otherwise, the backslashes are special to
>gawk since the entire string in windows is passed to gawk including all
>quotes (command.com and cmd.exe does not remove quotes but only ingnores
>what is between them)
I assume that, like me, you didn't do any testing before posting. Quite
possibly because, like me, you don't have actually have a GAWK.EXE on
your DOS/Windows system to test with. And, like me, you realize that in
DOS/Windows, the details of command line parsing are
application-specific. I.e., each possible EXE file can do it differently.
Having said all that, I don't think that:
gawk "BEGIN { FS=\",\"}"
under DOS/Windows is any more likely to work than:
gawk 'BEGIN { FS=\",\"}'
is likely to work under Unix. I hope you can see what I mean and that I
don't have to explain further.
--
(This discussion group is about C, ...)
Wrong. It is only OCCASIONALLY a discussion group
about C; mostly, like most "discussion" groups, it is
off-topic Rorsharch revelations of the childhood
traumas of the participants...
|
|
0
|
|
|
|
Reply
|
gazelle
|
4/12/2010 4:43:23 PM
|
|
On Mon, 12 Apr 2010 18:19:52 +0200, Janis Papanagnou wrote:
> Owner schrieb:
>> Can anyone tell me what's wrong with this command?
>>
>> C:\Users\Owner>gawk "BEGIN { FS = , }"
>
> You use the wrong OS.
winddows 7
>
> But more seriously; strings need to be quoted as in (Note: this is Unix
> shell syntax)
>
> gawk 'BEGIN { FS = "," }'
>
> Problem is that on your OS you seem to need using double quotes to embed
> the awk program, which probably forces you to escape all double quotes
> that appear around any strings in the awk program, probably
>
> gawk "BEGIN { FS = \",\" }"
thanks it worked!!
>
> or you have to put your awk code in a file, say a_file, and call if as
>
> gawk -f a_file
>
> where you avoided the quoting issue on your OS. Another option in this
> specific case is that you use an awk command line option to set the
> variable FS;
>
> gawk -F, "..."
used to use this option
>
> Again, the comma might need some escaping/quoting on your OS.
>
> Janis
>
>
>> gawk: cmd. line:1: BEGIN { FS = , }
>> gawk: cmd. line:1: ^ parse error
>>
>>
|
|
0
|
|
|
|
Reply
|
Owner
|
4/12/2010 5:10:10 PM
|
|
Kenny McCormack said the following on 4/12/2010 11:43 AM:
> In article<hpvht7$2fk$1@pop.motzarella.org>, pop<p_o_p@hotmail.com> wrote:
> ...
>> Partially true: backslashes won't work if the FS string contains a
>> special character to windows. Otherwise, the backslashes are special to
>> gawk since the entire string in windows is passed to gawk including all
>> quotes (command.com and cmd.exe does not remove quotes but only ingnores
>> what is between them)
>
> I assume that, like me, you didn't do any testing before posting. Quite
> possibly because, like me, you don't have actually have a GAWK.EXE on
> your DOS/Windows system to test with. And, like me, you realize that in
> DOS/Windows, the details of command line parsing are
> application-specific. I.e., each possible EXE file can do it differently.
>
> Having said all that, I don't think that:
>
> gawk "BEGIN { FS=\",\"}"
>
> under DOS/Windows is any more likely to work than:
>
> gawk 'BEGIN { FS=\",\"}'
>
> is likely to work under Unix. I hope you can see what I mean and that I
> don't have to explain further.
>
Not to get into a "knowledge contest" but I do have gawk.exe on my
windows system and have used (and tested) it for years so the solution
as stated does work although there are other solutions that may work
better under windows but the OP only wanted to know what was wrong with
his command as presented and you gave a good workaround without quotes.
No disrespect intended or taken.
--
(^\pop/^)
I'm lost... I've gone to look for myself.
If I should return before I get back, keep me here.
--
|
|
0
|
|
|
|
Reply
|
pop
|
4/12/2010 5:13:57 PM
|
|
Owner schrieb:
> On Mon, 12 Apr 2010 18:19:52 +0200, Janis Papanagnou wrote:
>
>> Owner schrieb:
>>> Can anyone tell me what's wrong with this command?
>>>
>>> C:\Users\Owner>gawk "BEGIN { FS = , }"
>> You use the wrong OS.
>
> winddows 7
In this respect WinDOS 7 is not really better than any other
WinDOS, I suppose; it's the WinDOS inherent quoting (and quote
expansion) philosophy that doesn't seem to have changed since
decades. (Might be different with so called '"Power" shell'?
Dunno. Nevermind.)
Janis
|
|
0
|
|
|
|
Reply
|
Janis
|
4/12/2010 5:29:19 PM
|
|
In article <hpvkd2$l99$1@pop.motzarella.org>, pop <p_o_p@hotmail.com> wrote:
....
>No disrespect intended or taken.
OK - likewise.
Incidentally, it does still stand that every EXE is potentially different.
I'm pretty sure that among the various {InsertNameOfUnixUtilHere}.EXEs
that I've downloaded over the years, I've seen lots of different command
line parsing methods and quirks. Even among various GAWK.EXEs. The
point is, there is no standard.
--
(This discussion group is about C, ...)
Wrong. It is only OCCASIONALLY a discussion group
about C; mostly, like most "discussion" groups, it is
off-topic Rorsharch revelations of the childhood
traumas of the participants...
|
|
0
|
|
|
|
Reply
|
gazelle
|
4/12/2010 5:33:43 PM
|
|
|
10 Replies
271 Views
(page loaded in 0.072 seconds)
Similiar Articles: FS = , is error? - comp.lang.awkCan anyone tell me what's wrong with this command? C:\Users\Owner>gawk "BEGIN { FS = , }" gawk: cmd. line:1: BEGIN { FS = , } gawk: cmd. line:1: ... iostat -E error count reset - comp.unix.solarisFS = , is error? - comp.lang.awk reset iostat -e error counters - comp.unix.solaris FS = , is error? - comp.lang.awk iostat -E error count reset - comp.unix.solaris FS ... reset iostat -e error counters - comp.unix.solarisFS = , is error? - comp.lang.awk reset iostat -e error counters - comp.unix.solaris FS = , is error? - comp.lang.awk iostat -E error count reset - comp.unix.solaris FS ... KERNEL - Thermal, fan, processor and other modules built-in - comp ...FS = , is error? - comp.lang.awk KERNEL - Thermal, fan, processor and other modules built-in - comp ..... the * option in menuconfig obviously ) Btw, during the bootup I ... zfs dataset and fs - comp.unix.solarisFS = , is error? - comp.lang.awk zfs dataset and fs - comp.unix.solaris freebsd-fs - ZFS "Dataset is busy" error I am attempting to test the interation of ZFS snapshots ... Fractal dimension using Higuchi's algorithm - comp.soft-sys.matlab ...FS = , is error? - comp.lang.awk Katz algorithm implementation to find fractal dimension of a ... FS = , is error? - comp.lang.awk Katz algorithm implementation to find ... gawk/Windows/cmd.exe/ARGV - comp.lang.awkFS = , is error? - comp.lang.awk gawk/Windows/cmd.exe/ARGV - comp.lang.awk FS = , is error? - comp.lang.awk >> gawk since the entire string in windows is passed to gawk ... ??? Error using ==> emlmex ??? Subscripting into an mxArray is not ...... is the matlab code for which I am trying to generate a mex code. but getting an error. ... u','v','Lu','Lv','k'); no_terms_FS=5; no_unknown_single_variable=(no_terms_FS^2 ... Windows MPICH problem - comp.parallel.mpiIt typically > runs fine until almost finished and then I see something nice like: > > Error 64, process 0, host BOYA-FS: > GetQueuedCompletionStatus failed for socket ... nested Anova with Random factor - comp.soft-sys.matlabYou could omit the trip factor and recognize that the error term includes the trip effect as well. Here's how you might do that: >> X = [dn fs (1:19)']; % bird ... Wrong FS Error while mounting USB flash drive in Linux « The ...Recently, when I plug in my USB flash drive into my Acer 3680 running Mandriva 2008.1, I got the following error: mount: wrong fs type, bad option, bad ... EXT2-fs warning: mounting fs with errors, running e2fsck is ...I am getting a warning "EXT2-fs warning: mounting fs with errors, running e2fsck is recommended" on Ubuntu 10.04 64 bit on my laptop Dell 7/22/2012 5:33:26 PM
|