Greetings all,
I've been getting a little frustrated over my scripts as I'm not too experienced with powerful commands such as awk and sed. Hope to find some guidance here.
I need to extract the names of all directories within a specified directory, grab their names and then place each name... (5 Replies)
hi all,
need help with putting names in an array, i have a few servers which i look up by doing a 'find . -name "*.pid' and the format of the output is like following :
./servername/myserver.pid
i was wondering how can i iterate through and store each name in one array
my code is... (1 Reply)
I was wondering if ksh supported arrays. I have a script that may work with several hosts. I'd like a means of knowing how many hosts I'm working with and an easy way to access them (as variables) in a loop. I'm assuming there's some kind of foreach in shell scripting. (1 Reply)
Hi all,
Following code in ksh is giving error:
fileLimit=5
func(){
dir="$1"
format="$2"
array="$3"
i=0
ls -lrt $format | tail -${fileLimit} | while read f_det; do
files="${f_det},"
((i+=1))
done
eval $(echo set -A $array '"${files}"')
}
func "." "*.pl" "a"
echo... (10 Replies)
awk 'BEGIN { count=1;SITEARR=0;}
{ namespace=$5; if ( namescpace in SITEARR) { print "Found ",namespace; } else { SITEARR=namespace; } } }
END {
for ( k in SITEARR ) {
print SITEARR
}
}' $ev_file
This AWK code is still giving me duplicate entries in SITEARR, whereas I have tried to... (3 Replies)
Hi There,
I am writing a ksh script which assigns variable values from file "A" and passes that variables to file "B". While passing the parameters an additional "$" sign is being assigned to awk -v option.
Could any one help me with this please.
#!/bin/ksh
head -1... (3 Replies)
Hi All,
My Requirement is as follows:
1. User will input Source Sytem Code as input.
2. I have source system codes as 11, 34, 56, 99, 45 etc.
OS Version: SunOS 5.8 Generic_117350-62 sun4u sparc SUNW,Sun-Fire-V890
My code is like...
echo 'Source System Code: \c'
read varSSCode... (3 Replies)
Hi Guys,
My code is something like this
set -A A1 1 7 13 19
set -A A2 2 8 14 20
set -A A3 3 9 15 21
echo "Enter a number"
read number
for i in 0 2 3 4
do
if }" ]
then
do something
elif }" ]
then
do something
elif }" ]
then
do something (4 Replies)
RedHat 5
KSH
I am creating an array, and then using case to go through and count for specific words. Then the count gets stored as an expression.
string='ftp rcp rsh telnet ftp ftp'
set -A myarray $string
FTPCOUNT="0"
for command in ${myarray}
do
case $command in
ftp) FTPCOUNT=`expr... (2 Replies)
I want to extract each and single character from a password string and put it in an array.
I tried this :
set -A password "echo $passwd | awk '{for (i=1; i<=length($1); i++) printf "%s ",substr($1,i,1)}'`
It's working as long that the password string doesn't contains any *
I tried a few... (5 Replies)
Discussion started by: ce9888
5 Replies
LEARN ABOUT MINIX
ppmtosixel
ppmtosixel(1) General Commands Manual ppmtosixel(1)NAME
ppmtosixel - convert a portable pixmap into DEC sixel format
SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile]
DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC
LJ250 color inkjet printer.
If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table
begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file.
OPTIONS -raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com-
pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni-
tude larger than a compressed file and prints much slower.
-margin
If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci-
fied, a 1.5 inch left margin will offset the image.
PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?.
BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was
greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the
color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation.
SEE ALSO ppm(5)AUTHOR
Copyright (C) 1991 by Rick Vinci.
26 April 1991 ppmtosixel(1)