01-31-2002
Here's one that might help:
xstart=`date '+%j'`
xend=`expr $xstart - 30`
while [ $xstart -gt $xend ] ; do
if [ $xstart -lt 10 ]; then
echo 00"$xstart"
elif [ $xstart -lt 100 ]; then
echo 0"$xstart"
else
echo $xstart
fi
xstart=`expr $xstart - 1`
done
It's not the prettiest, but it does the trick.
9 More Discussions You Might Find Interesting
1. Solaris
hi
can anyone tell me how or where to set to enable history of command keyed in to be logged? so that it can be used or traced later.
thanks (3 Replies)
Discussion started by: legato
3 Replies
2. AIX
Hi All
We have a WEB Based application running on the IBM AIX server. There is a EOD Job which runs a UNIX script containing EOD Jobs. Say If any job fails then we have to explicitly comment out the jobs which were successfully executed and then re run the same.
Is there any was by which we... (7 Replies)
Discussion started by: Prashantckc
7 Replies
3. Red Hat
I have several RHEL systems that are on an isolated network so I can't run up2date or yum directly on them.
What is the best way to keep these systems updated and patched?
Thanks (4 Replies)
Discussion started by: wazzu62
4 Replies
4. Solaris
Hello guys, I have one script running that I need to keep it running 24x7 so I'd like to know how can I implement a sort of monitoring process I mean if for some reason this process dies somehow it gets automatically started again.
Thanks. (8 Replies)
Discussion started by: cerioni
8 Replies
5. Shell Programming and Scripting
Hi,
I am having a file which is fix length and comma seperated. And I want to replace values for one column.
I am reading file line by line in variable $LINE and then replacing the string.
Problem is after changing value and writing new file temp5.txt, formating of original file is getting... (8 Replies)
Discussion started by: Mruda
8 Replies
6. Shell Programming and Scripting
Hello,
Sorry for the poor tilte but I still don't know how to this.
Here is my problem.
I have to huge log file. In this log file I can know where is stored all my files. As I have to get a reporting of of files I only need to keep the file name but I don't know how to do it. I hope you... (5 Replies)
Discussion started by: Aswex
5 Replies
7. Shell Programming and Scripting
Hi forum.
How do I change the following date value with another value (while keeping the rest of the line) using sed? The date values can change so I need a general sed command to change the date value within the first quotation marks only.
Date values will be coming from 2 different files.... (2 Replies)
Discussion started by: pchang
2 Replies
8. Shell Programming and Scripting
Currently I have the following to separate the numeric values. However the decimal point get separated.
ls -lrt *smp*.cmd | awk '{print $NF}' | sed 's/^.*\///' | sed 's/\(*\)/ & /g'
As an example on the files
n02-z30-dsr65-terr0.50-dc0.05-4x3smp.cmd... (8 Replies)
Discussion started by: kristinu
8 Replies
9. UNIX for Dummies Questions & Answers
I want to replace strings in test2 according to test1 table. In doing so, I`m losing records that I dont need to replace, please suggest modifications.
what i have
$ cat > test1
a b
c d
$ cat > test2
a
a
a
d
d
what i tried
$ awk ' BEGIN {FS=OFS=" "} FNR==NR{a=$2;next}... (2 Replies)
Discussion started by: senhia83
2 Replies
LEARN ABOUT SUSE
sample1d
SAMPLE1D(l) SAMPLE1D(l)
NAME
sample1d - Resampling of 1-D data sets
SYNOPSIS
sample1d infile [ -Fl|a|c ] [ -H[nrec] ] [ -Ixinc ] [ -M[flag] ] [ -Nknotfile ] [ -Sxstart ] [ -Tx-col] [ -V ] [ -bi[s][n] ] [ -bo[s][n] ]
DESCRIPTION
sample1d reads a multi-column ASCII [or binary] data set from file [or standard input] and resamples the timeseries/profile at locations
where the user needs the values. The user must provide the column number of the independent (monotonically increasing or decreasing) vari-
able. Equidistant or arbitrary sampling can be selected. All columns are resampled based on the new sampling interval. Several interpola-
tion schemes are available.
infile This is a multi-column ASCII [of binary, see -b] file with one column containing the independent variable (which must be monotoni-
cally in/de-creasing) and the remaining columns holding misc. data values. If no file is provided, sample1d reads from standard
input.
OPTIONS
No space between the option flag and the associated arguments.
-F Choose from l (Linear), a (Akima spline), and c (natural cubic spline) [Default is -Fa]. You may change the default interpolant;
see INTERPOLANT in your .gmtdefaults file.
-H Input file(s) has Header record(s). Number of header records can be changed by editing your .gmtdefaults file. If used, GMT default
is 1 header record.
-I xinc defines the sampling interval. [Default is the separation between the first and second abcissa point in the infile]
-M Multiple segment file. Segments are separated by a record whose first character is flag. [Default is '>'].
-N knotfile is an optional ASCII file with the x locations where the data set will be resampled in the first column
-S For equidistant sampling, xstart indicates the location of the first output value. [Default is the smallest even multiple of xinc
inside the range of infile]
-T Sets the column number of the independent variable [Default is 0 (first)].
-V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].
-bi Selects binary input. Append s for single precision [Default is double]. Append n for the number of columns in the binary file(s).
[Default is 2 (or at least the number of columns implied by -T].
-bo Selects binary output. Append s for single precision [Default is double].
EXAMPLES
To resample the file profiles.tdgmb, which contains (time,distance,gravity,magnetics,bathymetry) records, at 1km equidistant intervals
using Akima's spline, try'
sample1d profiles.tdgmb -I1 -Fa -T1 > profiles_equi_d.tdgmb
To resample the file depths.dt at positions listed in the file grav_pos.dg, using a cubic spline for the interpolation, try
sample1d depths.dt -Ngrav_pos.dg -Fc > new_depths.dt
SEE ALSO
gmt(1gmt), filter1d(1gmt)
1 Jan 2004 SAMPLE1D(l)