Welcome!
Important information
-- Spectre and Meltdown vulnerabilities
-- Change in MX sources

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-17.1 Final release info here
-- antiX-17 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

Keyboard User Input in AWK language ?

Post Reply
Message
Author
Mennohexo
Forum Novice
Forum  Novice
Posts: 24
Joined: Sun Dec 11, 2016 5:18 pm

Keyboard User Input in AWK language ?

#1 Post by Mennohexo » Wed May 17, 2017 11:00 am

Hi ,

does someone knows how to make a keyboard input of data in the AWK programming language ?

Only for writing a value in a variable. string or number. that's all

For example : Type a value : ( i give X on keyboard)
Your value is X

x should be a variable declared in awk.

Very simple userinput such like Input command in basic.

But in awk it's different.


Regards

M
Last edited by Mennohexo on Wed May 17, 2017 2:33 pm, edited 1 time in total.

skidoo
Forum Regular
Forum Regular
Posts: 842
Joined: Tue Sep 22, 2015 6:56 pm

Re: Keyboard User Input in AWK language ?

#2 Post by skidoo » Wed May 17, 2017 11:29 am

Try rephrasing your question. What, specifically, are you trying to accomplish?

User avatar
Old Giza
Forum Regular
Forum Regular
Posts: 352
Joined: Wed Apr 16, 2014 10:31 pm

Re: Keyboard User Input in AWK language ?

#3 Post by Old Giza » Wed May 17, 2017 12:21 pm

Code: Select all

$ awk '/123/' << EOF
> hello
> there 123 abc
> 123 my
> the end
> EOF
there 123 abc
123 my

Mennohexo
Forum Novice
Forum  Novice
Posts: 24
Joined: Sun Dec 11, 2016 5:18 pm

Re: Keyboard User Input in AWK language ?

#4 Post by Mennohexo » Wed May 17, 2017 3:23 pm

awk 'BEGIN{print "Enter your Name: ";getline name < "-";print RS "Input entered by user is: "name}'

I got it. This works.

Just make little steps in awk gwak in MX16.

See you again.

Post Reply

Return to “General”