Sponsored Content
Top Forums Shell Programming and Scripting awk command line arguments not taking Post 302938341 by sri.phani on Saturday 14th of March 2015 03:10:35 PM
Old 03-14-2015
My understanding goes $1 $2 ... representing the commandline arguments

My understanding goes that when I use the $1 ... in the code, the values for thiese var's / parameters ($1...) should be given as arguments while running the program

and @Kumaran , I am in the correct direcorty.
@sea i'd assume 'aa aa aa aa' would be taken as a single string, also these are not the files rather just values for the parameters
@Rudic using ./minusf <<< "aa:aa:aa:aa" I have'nt got any output

However I still did not get any ouput.

Code:
# ./minusf.awk 'aa aa aa aa'
awk: can't open aa aa aa aa

 

10 More Discussions You Might Find Interesting

1. Programming

command line arguments

Hi How to pass multi line text as a command line argument to a program. (i.e) ./a.out hi this is sample 0 file1 where hi this is sample should be stored in argv 0 in argv and so on... (3 Replies)
Discussion started by: bankpro
3 Replies

2. Shell Programming and Scripting

command line arguments

-------------------------------------------------------------------------------- I have this while loop and at the end I am trying to get it to tell me the last argument I entered. And with it like this all I get is the sentence with no value for $1. Now I tried moving done after the sentence... (1 Reply)
Discussion started by: skooly5
1 Replies

3. UNIX for Dummies Questions & Answers

Command line arguments.

I am working on a script wherein i need the user to enter the Build ID for eg:the command line will show enter the build ID Now on entering the build ID it should be assigned to @ARGV. How can this be done.? (1 Reply)
Discussion started by: Varghese
1 Replies

4. Shell Programming and Scripting

using command line arguments as columns for pattern matching using awk

Hi, I wish to use a column, as inputted by a user from command line, for pattern matching. awk file: { if($1 ~ /^8/) { print $0> "temp2.csv" } } something like this, but i want '$1' to be any column as selected by the user from command line. ... (1 Reply)
Discussion started by: invinclible0009
1 Replies

5. Shell Programming and Scripting

Pass command line arguments to awk

I am trying to pass max as a sommand line argument when I call awk. Made the modification in the BEGIN but it is not working I'm getting an error as below: awk: txsrx.awk:82: (FILENAME=jcd.tx FNR=4161) fatal: cannot open file `40' for reading (No such file or directory) Somehow it... (2 Replies)
Discussion started by: kristinu
2 Replies

6. UNIX for Dummies Questions & Answers

command line arguments

hi, can someone how to accept command line arguments as a variable using in script? like: ./scriptname arguments by accept arguments, I can use it in my script? thx! (1 Reply)
Discussion started by: ikeQ
1 Replies

7. Shell Programming and Scripting

command line arguments

hi,,,, I want to create a command prompt, for example "prompt>", so my prompt need to handle commands, for example "prompt>cmd", so i want to know how to get arguments for my own commands cmd, i.e. default argc should contain arguments count and argv should point to the argument vector i.e, for... (2 Replies)
Discussion started by: vins_89
2 Replies

8. UNIX Desktop Questions & Answers

scripts taking arguments

I am trying to write a script using commands to print a sequence of numbers. However, I can't get jot to recognize what I give it. Terri$ cat mncmd echo "m=$1" echo "n=$2" $jot $2 Terri$ ./mncmd 1 10 m=1 n=10 ./mncmd: line 3: $2: command not found I've also tried Terri$ cat... (3 Replies)
Discussion started by: justOne21
3 Replies

9. UNIX for Dummies Questions & Answers

taking the output of awk command to a new file

cat doc | nawk -v da="${date}" '$23>199 {print $0 > "doc"+da+".txt"}' Every time(need to run every day) i run this, i want to a create a new file "doc_01 Aug.txt". Basically, i want to create a new file with date appended in it. The above command is creating a file with name "0".... (4 Replies)
Discussion started by: vagar11
4 Replies

10. Shell Programming and Scripting

How to pass command line arguments to awk program?

#!/bin/awk -f BEGIN { FS=":"; } { if ( $7 == "" ) { print $1 ": no password!"; } } I want to execute this program for a particular user to check for his password from the file /etc/passwd (as the input file) and the user details to be given... (1 Reply)
Discussion started by: sri.phani
1 Replies
pkgparam(1)							   User Commands						       pkgparam(1)

NAME
pkgparam - display package parameter values SYNOPSIS
pkgparam [-v] [-d device] [-R root_path] pkginst [param...] pkgparam -f filename [-v] [param...] DESCRIPTION
pkgparam displays the value associated with the parameter or parameters requested on the command line. The values are located in either the pkginfo(4) file for pkginst or from the specific file named with the -f option. One parameter value is shown per line. Only the value of a parameter is given unless the -v option is used. With this option, the output of the command is in this format: parameter1='value1' parameter2='value2' parameter3='value3' If no parameters are specified on the command line, values for all parameters associated with the package are shown. OPTIONS
Options and arguments for this command are: -d device Specify the device on which a pkginst is stored. It can be a directory pathname or the identifiers for tape, floppy disk, or removable disk (for example, /var/tmp, /dev/diskette, and /dev/dsk/c1d0s0). The special token spool may be used to rep- resent the default installation spool directory (/var/spool/pkg). -f filename Read filename for parameter values. -R root_path Defines the full path name of a subdirectory to use as the root_path. All files, including package system information files, are relocated to a directory tree starting in the specified root_path. -v Verbose mode. Display name of parameter and its value. OPERANDS
pkginst Defines a specific package instance for which parameter values should be displayed. param Defines a specific parameter whose value should be displayed. ERRORS
If parameter information is not available for the indicated package, the command exits with a non-zero status. EXIT STATUS
0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
pkgmk(1), pkgproto(1), pkgtrans(1), pkginfo(4), attributes(5) Application Packaging Developer's Guide NOTES
With the -f option, you can specify the file from which parameter values should be extracted. This file should be in the same format as a pkginfo(4) file. For example, such a file might be created during package development and used while testing software during this stage. SunOS 5.10 6 Nov 2000 pkgparam(1)
All times are GMT -4. The time now is 02:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy