Sponsored Content
Full Discussion: AWK : read unix command
Top Forums Shell Programming and Scripting AWK : read unix command Post 61666 by fwirbel on Monday 7th of February 2005 12:06:06 PM
Old 02-07-2005
Thanks for your interest in my problem :-)
However, it's still not working on my AIX machine ... grrrr
awk '
{
print "-> "$0
printf "Enter response :"
system("read a; echo $a") | getline var1
print "-- " var1 "$0 : " $0

} ' ./essai.lst
where essai.lst contains only A B C D letters (one by line).
I receive the following result:
[lou:root:/home/root:] ./essai.sh
-> A
Enter response :A
A
sh: 0: not found
-- $0 : A
-> B
Enter response :B
B
-- $0 : B
-> C

Strange ...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

need help on how to read command in unix

can any one please help me how to use "read" command for openig a file.i want to process the file record by record and then needs to search for a particular string at a particular position.can any one please let me know the code.i am new to the shell. below are sample sample records ... (3 Replies)
Discussion started by: raoscb
3 Replies

2. Shell Programming and Scripting

assign a command line argument and a unix command to awk variables

Hi , I have a piece of code ...wherein I need to assign the following ... 1) A command line argument to a variable e.g origCount=ARGV 2) A unix command to a variable e.g result=`wc -l testFile.txt` in my awk shell script When I do this : print "origCount" origCount --> I get the... (0 Replies)
Discussion started by: sweta_doshi
0 Replies

3. Shell Programming and Scripting

Unix, awk to read .ksh feed

I need some advice, I have live feed containing xml messages which means there is new messages every minute. I need a script that will run every 2 hours using the current time minus 2 hours ( which I able to do) However I have problem with the date formatting i.e. One date is... (3 Replies)
Discussion started by: INHF
3 Replies

4. UNIX for Dummies Questions & Answers

Read all files in a directory for a unix command

Hello, Below, I have a unix command, which can be executable for single file. cat input.txt | sort -k3,3 > output.txt I have 100 input files in a directory. It is hectic and time taking to run the above command for all the 100 files for 100 times. Now, I want to execute the above unix... (2 Replies)
Discussion started by: koneru_18
2 Replies

5. Shell Programming and Scripting

AWK getline command to read more then two lines

Hello, Am trying to print three lines in a single line using AWK getline command. Below is the command am trying and its displaying only two lines in a single line. Command: awk '{getline n; printf($0,t);next}' Can you please help me ? Thanks, Prince (1 Reply)
Discussion started by: prince1987
1 Replies

6. Shell Programming and Scripting

Help with UNIX READ command usage..

Tested on : bash Will be implementing on : ksh I dont know if this is weird , or my idea of Unix stdin or stdout is completely messed up , but if I use the following command, I am getting a proper output. ls -l | head -1 | while read a ; do echo $a ;done and the output is soemthing like... (5 Replies)
Discussion started by: kumarjt
5 Replies

7. Shell Programming and Scripting

Help me for using the awk command in UNIX

Hi, Can you please help me to find/display out last Friday's date of the month using awk command in Unix/Linux. i have found this command cal 03 2013 | awk 'NF>5{last = $6} END{print last}' it show the output in single digit date like :29 But i need its output will shown in Fri Mar... (20 Replies)
Discussion started by: avig
20 Replies

8. Shell Programming and Scripting

[Solved] awk command to read sequentially from a file until last record

Hello, I have a file that looks like this: Generated geometry (...some special descriptor) 1 0.56784 1.45783 -0.87965 8 1.29873 -0.8767 1.098789 ... ... ... ... Generated geometry (....come special descriptor) ... .... ... ... ... ... ... ... and... (4 Replies)
Discussion started by: jaldo0805
4 Replies

9. Shell Programming and Scripting

Read input file with in awk script not through command line

Hi All, Do we know how to read input file within awk script and send output toanother log file. All this needs to be in awk script, not in command line. I am running this awk through crontab. Cat my.awk #!/bin/awk -f function test(var){ some code} { } END { print"test code" } (5 Replies)
Discussion started by: random_thoughts
5 Replies

10. Shell Programming and Scripting

How to read a two files, line by line in UNIX script and how to assign shell variable to awk ..?

Input are file and file1 file contains store.bal product.bal category.bal admin.bal file1 contains flip.store.bal ::FFFF:BADC:CD28,::FFFF:558E:11C5,6,8,2,1,::FFFF:81C8:CA8B,::FFFF:BADC:CD28,1,0,0,0,::FFFF:81C8:11C5,2,1,0,0,::FFFF:81DC:3111,1,0,1,0 store.bal.... (2 Replies)
Discussion started by: veeruasu
2 Replies
lprsetup(8)						      System Manager's Manual						       lprsetup(8)

NAME
lprsetup - printer spooler set up program SYNOPSIS
/usr/sbin/lprsetup DESCRIPTION
The lprsetup command provides an interactive facility for administrating the line printers on your system. This utility is also the com- mand-line version of printconfig, a graphical user interface available in X-windows or the Common Desktop Environment (CDE). See the printconfig(8) reference page for information on invoking the graphical user interface. Note that when you invoke printconfig from the command line, you have options to run the interface in different formats. Printer configuration can also be performed from the SysMan Menu and SMS interfaces. The lprsetup program contains online help and default answers to questions about adding, deleting, or changing the characteristics of any of the line printers on your system. Whenever a question is asked, the default selection is given in brackets [ ]. You can press Return in response to the question to accept the default, or enter an alternate value for the given parameter. You can obtain help information at any prompt by entering a question mark (?). After the help information is displayed, you are reprompted. The lprsetup program uses the /etc/lprsetup.dat file to determine the list of supported printers. See lprsetup.dat(4) for a current list of supported printers. The program knows about all of the possible symbols in the /etc/printcap file. See printcap(4) for a current list. After you have entered a printer specification, and have verified that it is correct, lprsetup then creates the spooling directory, links the output filter, and creates an /etc/printcap entry for the new printer. If the printer is connected to your system, you must specify the printer device name which is in the lp printcap entry. If lp is set to /dev/ttynn, choose the default setting dev when you see the following prompt: printer connection type 'ct' If you choose dev, you are prompted for the baud rate, br. The default is the recommended baud rate for the selected printer. If lp is set to another device, for example /dev/lp0 the lprsetup program assumes that you are setting up a printer with a parallel port, for example, lg02. It does not prompt you for device type information, and serial port specific entries are not put into the /etc/printcap entry. If the printer is remote, that is, if it is connected to a remote machine, you must set the line printer device to NULL (lp=:) and provide the following information items: Printer synonyms Name of the remote machine Name of the remote printer Spooling directory on the local machine If the printer is connected to a LAT, you must specify LAT when prompted for the printer connection type. It is important to enter LAT in all uppercase letters. (The connection will not be made if you enter lat for the printer connection type.) After you specify LAT, the sys- tem prompts you for the baud rate (br). The default is the recommended baud rate for the selected printer. Configuring Compaq Advanced Printing Software When lprsetup is used under Compaq Advanced Printing Software, you must configure an inbound gateway defining the rm and rp print symbols in the /etc/printcap file. To use this option: After configuring the general print characteristics, you will be prompted to Enter the printcap symbol you wish to mod- ify... Enter rm and then enter a new vaue of @dpa. Confirm the new value. Enter rp and provide a print queue name, such as "printer1". Configuring Printing on Clusters When lprsetup is invoked on a cluster, additional options are available which enable you to setup and administer cluster-wide printing. The on print symbol is used in the /etc/printcap file to specify: localhost, for networked (TCP/IP) printers Cluster member (host) names on which the print queue will be shared Refer to the printcap(4) reference page and Cluster Administration guide for more information. SEE ALSO
Commands: latcp(8), MAKEDEV(8), printconfig(8), sysman(8), sysman_intro(8), sysman_station(8) Files: printcap(4), lprsetup.dat(4) Network Administration System Administration Cluster Administration Compaq Advanced Printing Software documentation lprsetup(8)
All times are GMT -4. The time now is 02:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy