Question: I want to remove duplicated columns/fields on the same row only. I tried, but I ended up with a long code with nest loops, conditions and arrays that doesn't work correctly.

* input data:

```
1 2 3 4
1 2 3 1
1 2 1 3
4 4 3 2
3 3 3 2
1 1 1 1
5 2 2 7

```
* desired output:

```
1 2 3 4
1 2 3 
1 2 3
4 3 2
3 2
1
5 2 7

```

Answer: 
The `print` statement in `awk` takes one of three forms:

* `print > expression`
* `print >> expression`
* `print | expression`

... where the `>`, `>>`, and `|` bit, and the `expression` that follows, are optional.

The `print > expression` command will cause the output to go to a file named by whatever string that `expression` evaluates to. If the file exists, it will be truncated (emptied). This is similar to how output redirection in the shell works, but the file will not be truncated by executing the same `print` statement a second time, unless `close(expression)` is used to close the file related to `expression` first.

The `>>` and `|` forms of the `print` command are also inspired by how the shell handles these tokens but see an `awk` manual for further information about these forms.

In your code, you have

```c
print 3 > 5 ? "Hello" : "World"

```

This matches the `print > expression` syntax and would therefore output the string `3` to a file called `5`. The rest of that line continues with a question mark, which your `awk` can't make much sense out of, so it complains about it. Some `awk` implementations would use the `5 ? "Hello" : "World"` bit as the `expression` and would therefore write `3` to a file called `Hello` (since `5` is a *true* value when used as a boolean).

What you most likely wanted to do is

```c
print ( 3 > 5 ? "Hello" : "World" )

```

or

```c
print ( 3 > 5 ) ? "Hello" : "World"

```

This ensures that the `print > expression` syntax isn't triggered.
Use text only for your demos.

Use parentheses around your expression:

```bsh
$ awk 'BEGIN{print (5>3 ? "Hello":"World")}'
Hello
$ awk 'BEGIN{print (3>5 ? "Hello":"World")}'
World

```

May be, `>` character is interpreted like a redirection to a file for print command