Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Looping Logic, Need to implement Post 302848709 by Nsharma3006 on Thursday 29th of August 2013 10:07:45 PM
Old 08-29-2013
Looping Logic, Need to implement

I need to implement a looping logic.

Code:
If [ Test = 1] then
Go to /path1/file*

Get all the filename starting with file* and store it in a array
count file number and store it in variable like run
Ex: I found 3 file with starting file* so my run = 3
means my loop should run three time
May be like this

Code:
While run =3

for first filename, it search 'a' is there in the file if yes
echo ' a is exist'
else
echo 'a is not exist
run ++

so next time it again run and search 'a' in the second file to
echo ' a is exist'
else
echo 'a is not exist
run ++


and same again it search 'a' in the third file.


Kindly help
 

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Logic needed to recursive looping in the script

Hello i have a requirement where in a file i will get string. The length could be from 1 to 20. if the string is less than 6 characters ( ex: ABCD) . i need to append 'X' on right hand side to make it 6 characters (ex: ABCDXX). if suppose i get the same string from the file as ABCDXX then i... (5 Replies)
Discussion started by: dsdev_123
5 Replies

2. Shell Programming and Scripting

Need logic to implement file compare.

Hi all I have a requirement where i have to develop a file compare tool. Requirement: I have one expected file and one actual file. Both the files are database dumps in a csv file comma seperated. The first line of the file has the column names. Now there are 3 scenarios: 1) Firstly we have... (0 Replies)
Discussion started by: Ganesh_more
0 Replies

3. Shell Programming and Scripting

How to implement "not in" logic in UNIX script?

Hi Gurus, I need use "not in " logic in my script, like below if $name not in exception_file_list, then do something. anyone can help out this? Thanks in advance. (5 Replies)
Discussion started by: ken6503
5 Replies

4. Programming

Missing Logic Looping Through Switch Statement

Having trouble with the logic when looping over this switch case again: for (j = 0; data != 0; j++){ switch(data){ case 'c': output = ranit(r_brace_array); break; case 'h': output = ranit(pipe_array); break; ... (6 Replies)
Discussion started by: Azrael
6 Replies
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)
All times are GMT -4. The time now is 11:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy