is there a way to choose the complement from the output from the sequense in "ksh -o vi"
root# ls
testa testb
root# cat tes
1) testa
2) testb
root# cat tes <-- what to do now?
this output looks like a select function, otherwise the numbers wouldn't make sense, is there a chance to use... (2 Replies)
I have:
datafile contains 1234567890
>wc -c datafile | awk '{print $1}'
>11
The program
#!/bin/ksh
let n = (wc -c datafile | awk '{print $1}')
echo $n
I expect n to be 11 but it gives error message. What is wrong with this statement?
Thanks! (3 Replies)
Hello,
First of all, I am trying to duplicate the sum command using ksh/nawk
Lets assume the following algorithms work just fine and there is no calculation errors what so ever (which I doubt at this minute).
For now, I wanna make sure the script uses the BSD algorithim if -r is used... (0 Replies)
Ok, So up front I'm going to say that I'm a very elementary scripter, and I tend to use tools I don't fully understand, but I shotgun at something until I can get it to work...that said, I can't for the life of me understand why I can't get this to go down the way I want it to.
The goal:
-to... (6 Replies)
I'm not confident at all on how arrays work.
I want to know how to set arrays in ksh and in nawk (is there a difference??)
if someone can show me some examples of both that will be great. Tried to look up on the net but was confusing me more.
Any help would be appreciated. (2 Replies)
Hello Everyone,
I don't know what is wrong with this:
Is it that nawk cannot run a ".sh" script or is it not treating "." as a literal. If so how to make "." be treated as a literal in "nawk" statemnts?
Thanks in Advance (2 Replies)
hi all
i have the following portion in an xml file:
</n:AOMessage>
<?xml version="1.0" encoding="UTF-8"?>
<n:AOMessage xmlns:n="urn:ao:hs:update:shell" xmlns:bo="urn:ao:hs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ao:hs:update:shell... (0 Replies)
I am trying to use either awk or nawk in ksh88 to grep the word "Reason" in multiple files and than print the lines that say "Reason" in a particular format that is different from how they would normally print. The original input is as follows:
... (10 Replies)
Hey all. I'm writing a script to automatically login to a router, change directories to where crashfiles are located, then listing all files in that directory. This is where I'm at so far and wish to have some user interaction to choose the files.
What I am trying to do is list the files and get... (1 Reply)
Discussion started by: Gouda
1 Replies
LEARN ABOUT PHP
datetimeinterface.format
DATETIMEINTERFACE.FORMAT(3) 1 DATETIMEINTERFACE.FORMAT(3)DateTime::format - Returns date formatted according to given format
Object oriented style
SYNOPSIS
public string DateTime::format (string $format)
DESCRIPTION
string DateTimeImmutable::format (string $format) string DateTimeInterface::format (string $format)
Procedural style
string date_format (DateTimeInterface $object, string $format)
Returns date formatted according to given format.
PARAMETERS
o $object
-Procedural style only: A DateTime object returned by date_create(3)
o $format
- Format accepted by date(3).
RETURN VALUES
Returns the formatted date string on success or FALSE on failure.
EXAMPLES
Example #1
DateTimeInterface.format(3) example
Object oriented style
<?php
$date = new DateTime('2000-01-01');
echo $date->format('Y-m-d H:i:s');
?>
Procedural style
<?php
$date = date_create('2000-01-01');
echo date_format($date, 'Y-m-d H:i:s');
?>
The above example will output:
2000-01-01 00:00:00
NOTES
This method does not use locales. All output is in English.
SEE ALSO date(3).
PHP Documentation Group DATETIMEINTERFACE.FORMAT(3)