10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
grt=`sort -nr line_count.txt|head -1`
while read $dline
do
if $grt" -eq "`wc -l combo_operncount.$dline|awk '{print $1}'`" ]
then
awk -F, '{print $1}' combo_operncount.$dline > FULLD7
else
echo combo_operncount.$dline >> filecoll.txt
fname=`cat filecoll.txt|tr -s "\n" " "`
echo $fname... (6 Replies)
Discussion started by: nikhil jain
6 Replies
2. Shell Programming and Scripting
Hi All,
I'm building a new shell script but i'm facing a problem with one line which is giving "bad substitution" error. Please assist
script lines:
#!/bin/sh
printf "%s: " "Occurrence DATE (YYYYMMDD)"; read DATE
shortdate=${DATE#??}
o/p:
./test1: bad substitution
This command is... (2 Replies)
Discussion started by: Dendany83
2 Replies
3. Shell Programming and Scripting
Hello,
In bash I can use the following:
TMP=12345
MID=${TMP:1:1}
the expected result is: 2
but when using KSH I'm getting a ''bad substitution" error.
What is the correct syntaxin ksh?
Thanks (2 Replies)
Discussion started by: LiorAmitai
2 Replies
4. Shell Programming and Scripting
hi,
i created a shell script having the following content:
#! /usr/bin/ksh
FROM="myemail@domain.com"
MAILTO="someemail@domain"
SUBJECT="TEST"
BODY="/export/home/adshocker/body.txt"
ATTACH="/export/home/adshocker/attach.prog"
echo $ATTACH
ATTACH_NAME="${ATTACH##*/}"
echo $ATTACH_NAME... (5 Replies)
Discussion started by: adshocker
5 Replies
5. Solaris
Dear All
i am getting "bad substituion" error in the follwing piece of code when i run from crontab.however it works if i run directly from my machine.
#!/bin/bash
for i in `cat abc`
do
part1=${i:0:12} ;
part2=${i:13:27} ;
echo "$part1,$part2">> def
done (1 Reply)
Discussion started by: asadlone
1 Replies
6. UNIX for Advanced & Expert Users
when i say
$crontab z
it says ==>
"z":6: bad minute
"z":6: bad minute
errors in crontab file, can't install.
any clue why its happening? (1 Reply)
Discussion started by: crackthehit007
1 Replies
7. Ubuntu
Hi,
Iam trying to run a gmake command and have the latest version of Gnu in my redhat linux system.
I need to execute the following steps;
---> chmod +x utils/*
---> ./utils/AllCodeManagerFix
---> gmake LINUX
Iam able to do the chmod command but when I run the second command I get... (2 Replies)
Discussion started by: viji19812001
2 Replies
8. Programming
Dear Experts,
I have been suffering in porting a CFD code called OpenFOAM to sgi-IRIX system for many months but to no avail, and the problem is about MPI!
I installed gcc-4.3.0, gnu-binutils for my compilation.
And after the building process, I can run the executive with single CPU, but when... (1 Reply)
Discussion started by: lakeat
1 Replies
9. HP-UX
Hello,
i am having b2000 hp- visulized matchine, which i am using as server, i booted in maintanance mode and increased root file system lvm, after reboot i can not boot system and getting "bad LIF magic error", i tried to installed O/S again (hpux 10.20 ro hpux 11) but i can not installed its... (0 Replies)
Discussion started by: arvijain
0 Replies
10. UNIX for Advanced & Expert Users
What is wrong with my syntax, I am getting bad number error. The following lines of code get the value from INI file but the variable is a combination of multiple variables. When compiling all together, I get a bad number error or changing the '((' with '{{' gets me bad substitution error. The... (2 Replies)
Discussion started by: moan71
2 Replies
EASTER_DAYS(3) 1 EASTER_DAYS(3)
easter_days - Get number of days after March 21 on which Easter falls for a given year
SYNOPSIS
int easter_days ([int $year = date("Y")], [int $method = CAL_EASTER_DEFAULT])
DESCRIPTION
Returns the number of days after March 21 on which Easter falls for a given year. If no year is specified, the current year is assumed.
This function can be used instead of easter_date(3) to calculate Easter for years which fall outside the range of Unix timestamps (i.e.
before 1970 or after 2037).
The date of Easter Day was defined by the Council of Nicaea in AD325 as the Sunday after the first full moon which falls on or after the
Spring Equinox. The Equinox is assumed to always fall on 21st March, so the calculation reduces to determining the date of the full moon
and the date of the following Sunday. The algorithm used here was introduced around the year 532 by Dionysius Exiguus. Under the Julian
Calendar (for years before 1753) a simple 19-year cycle is used to track the phases of the Moon. Under the Gregorian Calendar (for years
after 1753 - devised by Clavius and Lilius, and introduced by Pope Gregory XIII in October 1582, and into Britain and its then colonies in
September 1752) two correction factors are added to make the cycle more accurate.
PARAMETERS
o $year
- The year as a positive number. If omitted, defaults to the current year according to the local time.
o $method
- Allows Easter dates to be calculated based on the Gregorian calendar during the years 1582 - 1752 when set to CAL_EASTER_ROMAN.
See the calendar constants for more valid constants.
RETURN VALUES
The number of days after March 21st that the Easter Sunday is in the given $year.
EXAMPLES
Example #1
easter_days(3) example
<?php
echo easter_days(1999); // 14, i.e. April 4
echo easter_days(1492); // 32, i.e. April 22
echo easter_days(1913); // 2, i.e. March 23
?>
SEE ALSO
easter_date(3).
PHP Documentation Group EASTER_DAYS(3)