07-28-2009
mmin not working in ksh
We have created a unix shell script to read a datafiles from specific input directory in Unix.
Users will be copying datafiles to the same input unix directoty.
During Testing we observed Unix Shell Script also read the incomplete datafiles which is still copying by the users.
As per requirement Shell Script should not read files which is still being copied/written.
any commnds to differentiate files which is in writing mode?
currently i have used "ls *.csv" commnd in the script to list out all csv files which will be furhther veeing processed.But its also listing files which is still being copied/written.So i thought of differntiation such files by not selecting them for processing, to do so i can use mtime/mmin option.
mtime is good if i am slecting files which is not modified in hours.
but my requirement is not to slect files whose modified time is less than 5 minutes.So i would like to go for mmin.
i am using HP-UX(KSh) mmin is not working....
$ find . -name "14*.000" -type f -mmin +1
find: bad option -mmin
get this error
any idea hwy mmin is not working in HP-UX( Ksh )
10 More Discussions You Might Find Interesting
1. AIX
Following code is working in bash but not in ksh.
Can someone please send me an alternative?
#!/bin/ksh
fname="EOA.dmp"
echo $fname
logname=${fname/.dmp/.log}
echo $logname
I am getting below error in ksh
"testcmd: logname=${fname/.dmp/.log}: 0403-011 The specified substitution is not... (2 Replies)
Discussion started by: arsheshadri
2 Replies
2. Solaris
Hi,
Following code is working in bash but not in ksh.
Can someone please send me an alternative?
#!/bin/ksh
fname="EOA.dmp"
echo $fname
logname=${fname/.dmp/.log}
echo $logname
I am getting below error in ksh
"testcmd: logname=${fname/.dmp/.log}: 0403-011 The specified substitution... (3 Replies)
Discussion started by: arsheshadri
3 Replies
3. AIX
Hi,
I have a strange problem with a AIX server, user are having problem with using du will in their ksh shell, if they switch to sh or bash there is not problem. root account that are using ksh but have not problem with du.
this is the error messages when trying to run du
du: can't find... (5 Replies)
Discussion started by: robertngo
5 Replies
4. Shell Programming and Scripting
I need to compare the time a file was last modified against current time and conditionally proceed.
At the command prompt I can do:
find MYFILE -mmin +1140
and it lists the file. But I need to test, and if true do something
I’ve tried things like:
if ; then
if ; then
etc. ... (2 Replies)
Discussion started by: tlavoie
2 Replies
5. Shell Programming and Scripting
#! /bin/ksh
rm -f ./xyz file --- this line is working
// Below any if stmt is not working.
if
then
echo " blah blah "
fi
or I replaced above if with
if
then
echo "dir exists"
fi
This is also not working.
I am new to KSH. So can someone help why if stmt is not... (31 Replies)
Discussion started by: saggy9583
31 Replies
6. Shell Programming and Scripting
Hi,
I want to parameterise the argument for 'mmin' to find out files created/edited 'n' minutes ago.
For this i have written something as simple as the following:
n=10
m=-1
c=expr $n \* $m #value comes to -10 when echoed
find -mmin -10 #works
find -mmin $c #doesnt work ... (5 Replies)
Discussion started by: SheetalN
5 Replies
7. Shell Programming and Scripting
Dear All,
We are having the script which is creating the folder on another server if it is not present using ssh. Using scp it copies copy all pdf files from local folder to server folder.
After all copy is done, Just to verify i was using the below find command
find... (3 Replies)
Discussion started by: yadavricky
3 Replies
8. Shell Programming and Scripting
Here's the script:
#!/usr/bin/ksh
Date=`date +%m%d%y`
CDate=`date`
FileName=cintas_hosts_and_users.$Date
echo $CDate >> $FileName
#echo $FileName
for host in `cat /collect/itthomp/cintas_hostnames.dat`
do
echo $host >> $FileName
ssh $host "awk -v Fname=$FileName -F: '{if($1 != "root"... (3 Replies)
Discussion started by: jgt157
3 Replies
9. Shell Programming and Scripting
Hi,
I tried the following but giving me all the files in the directory ,
Where i need the files which are assigned to variable like below
#!/bin/ksh
Src_Dir="/home/etc"
file_nm ="ab.temp"
for File in `ls $Src_Dir/$file_nm*`
do
File=`basename $File`
echo $File
... (2 Replies)
Discussion started by: smile689
2 Replies
10. Shell Programming and Scripting
Hi
I am not able to execute a script with ksh. Its not giving any error too.
I have tried with absolute path /usr/bin/ksh test.sh .
Also checked path variable and all looks fine
It runs fine with sh.
OS is solaris 10. (9 Replies)
Discussion started by: ningy
9 Replies
LEARN ABOUT OPENDARWIN
fixup_datafile
fixup_datafile(3alleg4) Allegro manual fixup_datafile(3alleg4)
NAME
fixup_datafile - Fixes truecolor images in compiled datafiles. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
void fixup_datafile(DATAFILE *data);
DESCRIPTION
If you are using compiled datafiles (produced by the dat2s and dat2c utilities) on a platform that doesn't support constructors (currently
any non GCC-based platform), or if the datafiles contain truecolor images, you must call this function once after your set the video mode
that you will be using. This will ensure the datafiles are properly initialised in the first case and convert the color values into the
appropriate format in the second case. It handles flipping between RGB and BGR formats, and converting between different color depths when-
ever that can be done without changing the size of the image (ie. changing 15<->16-bit hicolor for both bitmaps and RLE sprites, and
24<->32-bit truecolor for RLE sprites).
Note that you can only call this once and expect it to work correctly, because after the call the DATAFILE you fixed up is permanently con-
verted to whatever is the current component ordering for your screen mode. If you call fixup_datafile again, the function assumes you have
a freshly loaded datafile. It cannot "undo" the previous conversion.
If your program supports changing resolution and/or color depth during runtime, you have two choices: either call fixup_datafile() just
once and hope that the component ordering and bit depth doesn't change when the screen mode changes (unlikely). Or, you can reload your
datafiles when the screen mode changes.
SEE ALSO
set_gfx_mode(3alleg4), set_color_conversion(3alleg4)
Allegro version 4.4.2 fixup_datafile(3alleg4)