Sponsored Content
Top Forums Shell Programming and Scripting "date" difference between FreeBSD & Linux Post 302462275 by fpmurphy on Wednesday 13th of October 2010 07:47:39 PM
Old 10-13-2010
Some shells,e.g. ksh93, already have comprehensive builtin date arithmetic
Code:
$ printf "%(%Y-%m-%d %r %Z)T\n"  "5/7/05 15:34 -0800"
2005-05-07 07:34:00 PM EDT

$ printf "%(%Y-%m-%d)T\n" "final friday dec 2010"
2010-12-31

These 2 Users Gave Thanks to fpmurphy For This Post:
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Nescape & dial up networking "Linux"

Sorry I need to Know How to connect to the Internet using Netscape in the GUI of the Red Hat Linux .....using phone line with a modem Us robbitics ....Such as in windows We add dial up adapter etc ......:confused: (1 Reply)
Discussion started by: atiato
1 Replies

2. What is on Your Mind?

[[ $(date +%Y) == 2007 ]] && echo "Happy New Year"

Same as the Title! :) (2 Replies)
Discussion started by: ripat
2 Replies

3. Shell Programming and Scripting

Difference between ">/dev/null 2>&1" and "2>&1 >/dev/null"

Does >/dev/null 2>&1 and 2>&1 >/dev/null mean the same? (4 Replies)
Discussion started by: proactiveaditya
4 Replies

4. Solaris

difference between "root" and "usr" packages

Hi, could someone pls enlighten me on the difference between the "root" package and "usr" package? Like in this example: pkginfo -l SUNWGtku | grep -i desc DESC: GTK - The GIMP Toolkit (Usr) and pkginfo -l SUNWGtkr | grep -i desc DESC: GTK - The GIMP Toolkit (Root)... (6 Replies)
Discussion started by: masloff
6 Replies

5. UNIX for Dummies Questions & Answers

Difference between "/bin/bash" & "/bin/sh"

what if the difference between #!/bin/sh and #!/bin/bash I wrote a script with the second heading now when i change my heading to the first one ...the script is not executing well....im not getting the required output....any solution to this problem...or do i have to start the... (3 Replies)
Discussion started by: xerox
3 Replies

6. Red Hat

files having Script which works behind "who" & "w" commands

Dear All, plz print the path of files which have the script of "who" & "w" commands. thnx in advance. (6 Replies)
Discussion started by: saqlain.bashir
6 Replies

7. Shell Programming and Scripting

finding the strings beween 2 characters "/" & "/" in .txt file

Hi all. I have a .txt file that I need to sort it My file is like: 1- 88 chain0 MASTER (FF-TE) FFFF 1962510 /TCK T FD2TQHVTT1 /jtagc/jtag_instreg/updateinstr_reg_1 dff1 (TI,SO) 2- ... (10 Replies)
Discussion started by: Behrouzx77
10 Replies

8. Web Development

How would I mod_rewrite "/~a1Pha" and "/=a1Pha" to "/paste/a1Pha.htm"? (internally & externally)

Basically I want to shorten URLs on my html pasting site (pasteht.ml), by using "/~a1Pha" instead of "/paste/a1Pha". The ID is 5 numbers and letters, both cases. For example: /~idnum serves /paste/idnum.htm /=idnum serves /paste/idnum.htm /paste/idnum redirects to /~idnum (to update any old... (0 Replies)
Discussion started by: phillips1012
0 Replies
ECHO(1) 						    BSD General Commands Manual 						   ECHO(1)

NAME
echo -- write arguments to the standard output SYNOPSIS
echo [-n] [string ...] DESCRIPTION
The echo utility writes any specified operands, separated by single blank (' ') characters and followed by a newline (' ') character, to the standard output. The following option is available: -n Do not print the trailing newline character. The end-of-options marker -- is not recognized and written literally. The newline may also be suppressed by appending 'c' to the end of the string, as is done by iBCS2 compatible systems. Note that the -n option as well as the effect of 'c' are implementation-defined in IEEE Std 1003.1-2001 (``POSIX.1'') as amended by Cor. 1-2002. For porta- bility, echo should only be used if the first argument does not start with a hyphen ('-') and does not contain any backslashes (''). If this is not sufficient, printf(1) should be used. Most shells provide a builtin echo command which tends to differ from this utility in the treatment of options and backslashes. Consult the builtin(1) manual page. EXIT STATUS
The echo utility exits 0 on success, and >0 if an error occurs. SEE ALSO
builtin(1), csh(1), printf(1), sh(1) STANDARDS
The echo utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'') as amended by Cor. 1-2002. BSD
November 12, 2010 BSD
All times are GMT -4. The time now is 05:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy