07-20-2006
Pierre,
Do you mean i have to have the code like this:
integer filecount=0
for file in BARE01_DLY_???_$(date +%Y%m%d); do
filecount=$filecount+1
done
echo $filecount
if (( $filecount == 20 )); then
print "True"
else
print "False"
fi
is this right? How can i embed them in the single KSH script. Please let me know.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to write a script that will look for a file in a directory, then remove it. I need it to loop until it has removed a certain number of files. Is it better to do a repeat or to list each file in a pattern? Files will be numbered like RAF.01.*, RAF.02.*, etc. Thanks, James (6 Replies)
Discussion started by: JporterFDX
6 Replies
2. UNIX for Dummies Questions & Answers
Some simple questions from a simple man.
If i wanted to count the number of files contained within a directory, say /tmp would ls -l /tmp ¦ wc -l suffice and will it be accurate?
second one: How would i check the number of files with a certain string in the filename, in the same directory.
... (2 Replies)
Discussion started by: iamalex
2 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I have to copy a set of files abc* in /path/ to /path1/ as abc*_bkp.
The list of files appear as follows in /path/:
abc1
xyszd
abc2
re2345
abcx
..
.
abcxyz
I have to copy them (abc* files only) into /path1/ as:
abc1_bkp
abc2_bkp
abcx_bkp
..
. (6 Replies)
Discussion started by: new_learner
6 Replies
4. Shell Programming and Scripting
I have 10 appservers and each appserver has 4 jvms . Each of these logs is archived and stored on a nfs directory . For example the files are
/logs/200907/ap1-jvm1.server.log.20090715.gz
/logs/200907/ap2-jvm2.server.log.20090714.gz
/logs/200908/ap1-jvm1.server.log.20090812.gz
I want to... (3 Replies)
Discussion started by: gubbu
3 Replies
5. UNIX for Advanced & Expert Users
Hi all,
Need some help counting files... :)
I'm trying to count the number of files in a given directory (and subdirectories) which reportedly contains "thousands" of files.
I'm using this:
ls -R | wc -l
However it's been an hour and looks like it's still running; there is no output... (18 Replies)
Discussion started by: verdepollo
18 Replies
6. Shell Programming and Scripting
I am trying to display the output of ls and also print the number of characters in EVERY file name. This is what I have so far:
#!/bin/sh
for x in `ls`; do
echo The number of characters in x | wc -m
done
Any help appreciated (1 Reply)
Discussion started by: LinuxNubBrah
1 Replies
7. Shell Programming and Scripting
So I have a loop that stated if a directory exists or not. If it does it prints the number of files within that directory. I use this code...
result=`(ls -l . | egrep -c '^-')`
However, no matter which directory I input, it outputs the number "2"
What is wrong here? (4 Replies)
Discussion started by: itech4814
4 Replies
8. Shell Programming and Scripting
I have a file of 1.3 millions lines.
some are with the same word twice on the line, some line have two diffrent words.
each line has two words, one in brackets.
example:
foo (foo)
bar (bar)
thae (awvd)
beladf (vswvw)
I am sure this can be done with one line of... (6 Replies)
Discussion started by: robsonde
6 Replies
9. Shell Programming and Scripting
Im using the command below , but thats not the output that i want. it only prints the odd and even numbers.
awk '{if(NR%2){print $0 > "1"}else{print $0 > "2"}}'
Im hoping for something like this
file1:
Text hi this is just a test
text1 text2 text3 text4 text5 text6
Text hi... (2 Replies)
Discussion started by: invinzin21
2 Replies
10. Shell Programming and Scripting
Hi,
I need a ksh script to replace indirect directory references in an .ini file with a env variable using sed or awk.
The .ini file is for example as such:
A=..
B=../
C=../..
D=../../
E=../bin
F=../../bin
G=../../bin/xml
H=../../bin/xml/
Need to replace an instance of .. or... (2 Replies)
Discussion started by: andyatit
2 Replies
LEARN ABOUT SUSE
xpsetimageresolution
XpSetImageResolution(3Xp) XPRINT FUNCTIONS XpSetImageResolution(3Xp)
NAME
XpSetImageResolution - Sets the resolution for subsequent PutImage requests
SYNOPSIS
cc [ flag... ] file... -lXp [ library... ]
#include <X11/extensions/Print.h>
Bool XpSetImageResolution ( display, print_context, image_res, prev_res_return )
Display * display ;
XPContext print_context ;
int image_res ;
int * prev_res_return ;
ARGUMENTS
- display
Specifies a pointer to the Display structure.
- print_context
Specifies the print context on which to set the resolution.
- image_res
Specifies the image resolution in pixels per inch.
- prev_res_return
Returns the previous image resolution in pixels per inch.
DESCRIPTION
XpSetImageResolution returns True if the printer server allowed the resolution to be set, otherwise False is returned.
XpSetImageResolution sets the resolution for subsequent PutImage requests to the screen of the specified print context. If the return value
is False, then the print server does not support image scaling for the particular resolution given the current configuration of the
printer, and the application is responsible for any desired scaling. If the return value is True, then the contents of any subsequent
PutImage request to a Pixmap or to a Window on the screen of the specified print context will automatically be scaled as part of the PutIm-
age request. The scale factor is:
default_printer_resolution / image_res
Where default_printer_resolution is the current value of that page attribute. Only the image itself is scaled (meaning the effective width
and height of the image change), the dst-x and dst-y parameters to PutImage are not altered.
As a special case, a value of zero for image_res resets the resolution to automatically track the printer resolution; in this case (which
is also the default setting for a newly created print context), subsequent images will not be scaled.
If the return value is True and prev_res_return is a non-NULL pointer, then the previous image resolution that was set for the print con-
text is stored in prev_res_return.
XpSetImageResolution returns False immediately if image_res is negative or greater than 65535.
DIAGNOSTICS
XpBadContext A valid print context-id has not been set prior to making this call.
X Version 11 libXp 1.0.0 XpSetImageResolution(3Xp)