Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Avoid strange women and temporary variables.


devel / comp.unix.shell / Re: Priniting coloumns of a file using tcl

SubjectAuthor
* Re: Priniting coloumns of a file using tclLew Pitcher
`- Re: Priniting coloumns of a file using tclChris Elvidge

1
Re: Priniting coloumns of a file using tcl

<sfrg0m$8m6$4@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4252&group=comp.unix.shell#4252

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.shell
Subject: Re: Priniting coloumns of a file using tcl
Date: Sat, 21 Aug 2021 18:17:58 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <sfrg0m$8m6$4@dont-email.me>
References: <61e312bc-e35e-417c-8748-a068366a709bn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 21 Aug 2021 18:17:58 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="4c048f36795a1ac53ad121102537a23a";
logging-data="8902"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX195npdC6V73RW/Q5Tm7VlF1M+w7k0rqBDY="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:KkOa18+bupeUNCbHSXfGoQ4bGgw=
 by: Lew Pitcher - Sat, 21 Aug 2021 18:17 UTC

On Sat, 21 Aug 2021 10:47:42 -0700, gpa...@gmail.com wrote:

> Dear Experts,
>
> I am able to print the required columns in an output file with awk command using following command in a .SH file
> awk '{ print $1,$2,$5,$6 }' input_file1 > output_file2
>
> I want achieve the same thing using tcl command
> But when i used following command in a .TCL, file it throws the following error
> exec awk '{ print $1,$2,$5,$6 }' input_file1 > output_file2
> can't read "1": no such variable
>
> Could you please give me a correct syntax for the above issue?

Not really. tcl is (now) a moderately obscure scripting language, and
while I have the book ("Tcl and the Tk toolkit" by John K. Ousterhout)
I don't /know/ the language.

Please realize that the argument handling and quoting requirements of
TCL are /not/ the same as posix shell, and you will have to do some work
to translate from shell to TCL. If you are working in TCL, you probably
need to read the book; "Tcl and the Tk toolkit" is the canonical book on
TCL, written by the author of the TCL language.

HTH
--
Lew Pitcher
"In Skills, We Trust"

Re: Priniting coloumns of a file using tcl

<sfrhrf$8ke$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4253&group=comp.unix.shell#4253

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: chr...@mshome.net (Chris Elvidge)
Newsgroups: comp.unix.shell
Subject: Re: Priniting coloumns of a file using tcl
Date: Sat, 21 Aug 2021 19:49:18 +0100
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <sfrhrf$8ke$1@dont-email.me>
References: <61e312bc-e35e-417c-8748-a068366a709bn@googlegroups.com>
<sfrg0m$8m6$4@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 21 Aug 2021 18:49:19 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="3f891d24e6b81f150a91124d0843cbdf";
logging-data="8846"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+79EY51RR/MEK6DviDku/cjwkx8/R3hkE="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
Thunderbird/52.2.1 Lightning/5.4
Cancel-Lock: sha1:zvXorGRBAD+ozlvTHhwWI0znk2s=
In-Reply-To: <sfrg0m$8m6$4@dont-email.me>
Content-Language: en-GB
 by: Chris Elvidge - Sat, 21 Aug 2021 18:49 UTC

On 21/08/2021 07:17 pm, Lew Pitcher wrote:
> On Sat, 21 Aug 2021 10:47:42 -0700, gpa...@gmail.com wrote:
>
>> Dear Experts,
>>
>> I am able to print the required columns in an output file with awk command using following command in a .SH file
>> awk '{ print $1,$2,$5,$6 }' input_file1 > output_file2
>>
>> I want achieve the same thing using tcl command
>> But when i used following command in a .TCL, file it throws the following error
>> exec awk '{ print $1,$2,$5,$6 }' input_file1 > output_file2
>> can't read "1": no such variable
>>
>> Could you please give me a correct syntax for the above issue?
>
> Not really. tcl is (now) a moderately obscure scripting language, and
> while I have the book ("Tcl and the Tk toolkit" by John K. Ousterhout)
> I don't /know/ the language.
>
> Please realize that the argument handling and quoting requirements of
> TCL are /not/ the same as posix shell, and you will have to do some work
> to translate from shell to TCL. If you are working in TCL, you probably
> need to read the book; "Tcl and the Tk toolkit" is the canonical book on
> TCL, written by the author of the TCL language.
>
> HTH
>

First result from a search:
https://stackoverflow.com/questions/16990116/using-awk-in-tcl-script

--
Chris Elvidge
England

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor