05-07-2008
Denn,
you are right.
1. ls -l | awk '{print $9'} = ls -1 (no need for extra code)
Jartan,
Did you try what Denn provided?
ls -1 | xargs pkginfo 2> /var/tmp/errorfile
If the above errorfile has the whole error line, then you can add the while loop to just get the data between "".
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Is there a way with HP-UX Release 10.20 (but going to HP-UX 11) to convert a regular "text" file to a packed data format (such as is created by a Cobol program)? (2 Replies)
Discussion started by: HuskyJim
2 Replies
2. Shell Programming and Scripting
Hallo,
i need a Prompting read in my script:
read -p "Enter your command: " command
But i always get this Error:
-p: is not an identifier
When I run these in c-shell i get this error
/usr/bin/read: read: bad option(s)
How can I use a Prompt in the read command? (9 Replies)
Discussion started by: wiseguy
9 Replies
3. Shell Programming and Scripting
The script:
for i in $(awk '/\".*\"/' list.txt)
do
echo $i
done
iist.txt:
"Willie"
"Willie Willie"
"Willie Willie Wee"
"Willie Willie Wee Wee"
The results:
"Willie"
"Willie
Willie"
"Willie
Willie
Wee"
"Willie (6 Replies)
Discussion started by: Trapper
6 Replies
4. Shell Programming and Scripting
Hi -
I have a simple file (x.xml):
<tag1>text 1</tag1>
<tag2>text 2</tag2>
<tag3>text 3</tag3>
<tag4>text 4</tag4>
<tag5>text 5</tag5>
I am trying to run a simple nawk script against it in order to get the text contained within the tags:
nawk 'BEGIN{FS=""}
/tag1/{tag1=$3}... (3 Replies)
Discussion started by: nfr816
3 Replies
5. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
6. Shell Programming and Scripting
Hello everyone
Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried
sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies
7. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
8. UNIX for Dummies Questions & Answers
Hello,
I have a question regarding extracting parts of a string and the meaning of # and % in the syntax. I created an example below.
# filename=/first/second/third/fourth
#
# echo $filename
/first/second/third/fourth
#
# echo "${filename##*/}"
fourth
#
# echo "${filename%/*}"... (3 Replies)
Discussion started by: shah9250
3 Replies
9. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT MOJAVE
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)