Welcome!

Please read this important information about MX sources lists.
News
  • MX Linux on social media: here
  • Mepis support still here
Current releases
  • MX-17 beta 2 release info here
  • MX-16.1 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!
    • Read Forum Rules

Keyboard User Input in AWK language ?

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

Keyboard User Input in AWK language ?

#1 Postby 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: 574
Joined: Tue Sep 22, 2015 6:56 pm

Re: Keyboard User Input in AWK language ?

#2 Postby 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: 244
Joined: Wed Apr 16, 2014 10:31 pm

Re: Keyboard User Input in AWK language ?

#3 Postby 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: 22
Joined: Sun Dec 11, 2016 5:18 pm

Re: Keyboard User Input in AWK language ?

#4 Postby 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.


Return to “General”

Who is online

Users browsing this forum: No registered users and 1 guest