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.
Is this a homework assignment? Homework assignments must be posted in the Homework and Coursework Questions forum and you need to completely fill out the homework template before we can help you with your assignment.
Your understanding is incorrect. You are mixing shell command line parameter parsing with awk field parsing and coming up with something that doesn't work for either.
And, if you want your awk script to read /etc/passwd, you have to tell your awk script to read it; not just assume that awk can magically guess that that is the file you are trying to process.
Furthermore, I don't see anything in your code that makes any attempt to identify a line in the password file that will match any user you want to examine.
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)
--------------------------------------------------------------------------------
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)
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)
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)
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)
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)
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)
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)
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)
#!/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
LEARN ABOUT SUNOS
pkgparam
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)