Sponsored Content
Top Forums Shell Programming and Scripting Insert date/time header at top of file Post 302890991 by SriniShoo on Monday 3rd of March 2014 03:23:47 AM
Old 03-03-2014
use double quotes instead of single quotes in sed
Code:
sed -i "1s/^/********** $(date) **********\n\n/" $OUTPUT_PATH/$HOSTNAME

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SED- Insert text at top of file

Does anyone know how to insert text at the top and bottom of a file using sed? (12 Replies)
Discussion started by: MBGPS
12 Replies

2. Shell Programming and Scripting

Insert Time and Date Stamp

I have a directory with following files in it ABC.000.DAT ABC.001.DAT ABC.002.DAT ABC.003.DAT I want to insert time and date stamp in file names like ABC.000.YYYYMMDDHHMM.DAT I able to insert the time and date stamp at the end of filename Kindly help (1 Reply)
Discussion started by: aajmani
1 Replies

3. UNIX for Dummies Questions & Answers

Insert date/time within a filename

Hi Guys, I need to script the renaming of files as followins: files: firstjd secondjo thirdjv My script needs to insert the date/time infront of the last 2 characters of the filenames above, any ideas greatly received :) the letters before the last 2 characters could change, I'm only... (7 Replies)
Discussion started by: cooperman
7 Replies

4. Shell Programming and Scripting

insert text into top of file

how would you insert text into a existing file using aguments first arguments being the line of text and the second argument being file name (1 Reply)
Discussion started by: jimbob
1 Replies

5. UNIX for Dummies Questions & Answers

how do I insert argument into TOP of file using vi?

when directing some text into a file can you choose where it goes like the top of the file (which is text aswell) or the middle?? if so how - especially would like to know how to do so in vi (text editor) If i were to enter an argument ($1) into a another argument ($2) would it would be... (6 Replies)
Discussion started by: rprules
6 Replies

6. Shell Programming and Scripting

Processing a log file based on date/time input and the date/time on the log file

Hi, I'm trying to accomplish the following and would like some suggestions or possible bash script examples that may work I have a directory that has a list of log files that's periodically dumped from a script that is crontab that are rotated 4 generations. There will be a time stamp that is... (4 Replies)
Discussion started by: primp
4 Replies

7. Shell Programming and Scripting

best way to insert a line at the top of a file?

say I want to insert "this is a test" as the first line into file A, besides echo "this is a test" > /tmp/tmpfile cat /tmp/tmpfile fileA >> /tmp/result, is there any simple way I can do it? thanks (7 Replies)
Discussion started by: fedora
7 Replies

8. Shell Programming and Scripting

insert a header in a huge data file without using an intermediate file

I have a file with data extracted, and need to insert a header with a constant string, say: H|PayerDataExtract if i use sed, i have to redirect the output to a seperate file like sed ' sed commands' ExtractDataFile.dat > ExtractDataFileWithHeader.dat the same is true for awk and... (10 Replies)
Discussion started by: deepaktanna
10 Replies

9. UNIX for Advanced & Expert Users

Insert string in binary file at top

How can i append a EBCDIC string of 100 bytes to 0th position of a binary file in UNIX. (4 Replies)
Discussion started by: param_it
4 Replies

10. Shell Programming and Scripting

Insert date/time in reoccurring blocks of lines

Hi folks, I have a little problem, that is kinda bugging me :( ... I have a logfile, that looks kinda "crippled" in the raw format ... So far, I've managed, to get it in a format like this: PRI_PTA01,2W,30,30,0,0,0,0,0,0,0,0,0,0,0,0... (5 Replies)
Discussion started by: whizzler
5 Replies
WMTIME(1)						      General Commands Manual							 WMTIME(1)

NAME
wmtime - Window Maker dockapp that displays the time and date SYNOPSIS
wmtime [ OPTION ] DESCRIPTION
WMTime displays the time and date and gives you some nice additional features too. It is intended for docking in Window Maker. It currently provides: o the time and date; o a realtime morphing interface (analog <> digital mode); o auto-scaled and anti-aliased hands; o localization, displaying the day and date in various languages; o three user-defined commands to launch. OPTIONS
-d, -digital Display the digital clock on startup, instead of the analog clock. -display display This option specifies the X server to contact; see X(7x). -geometry geometry This option specifies the preferred position of clock; see X(7x). -n, -noseconds Disables the second hand. -h Show help information. -v Print the version number. USAGE
The WMTime window is separated into top and bottom sections. The top section contains a clock and the bottom section contains the date. The clock can be toggled between analog and digital modes. To do this, click in the bottom section of the window. WMTime can also be used to launch programs. You may click either left, middle, or right mouse buttons in the top section of the window. The pre-configured program will be launched according to the mouse button clicked. (see CONFIGURATION FILE below.) In order to move WMTime, drag on the outer edges. These are not sensitive to mouse clicks. DOCKING IN WINDOW MANAGERS
Window Maker Window Maker users should drag and drop the WMTime window on the Dock. Then, right-click on the border of the window and select "Settings...". Check "Start when Window Maker is started". AfterStep AfterStep users should put the following in their $HOME/.steprc Wharf wmtime - MaxSwallow "wmtime" wmtime & Other window managers WMTime runs nicely as a 64x64 shaped icon on your desktop. CONFIGURATION FILE
WMTime can launch three user-defined commands, triggered by left, middle and right mouse button clicks. You can define the commands to launch in $HOME/.wmtimerc left: xterm middle: xload right: xcalc If WMTime detects a $HOME/.wmtimerc file, it will launch the appropriate command when you click on the clock. The system administrator can define default commands in /etc/wmtimerc. The administrator may also choose to "fix" particular commands, making it impossible for users to change. These commands can be defined in /etc/wmtimerc.fixed, although this isn't a nice thing to do. FILES
/etc/wmtimerc $HOME/.wmtimerc /etc/wmtimerc.fixed AUTHORS
WMTime was written by Martijn Pieterse and Antoine Nulle. This manual page was written by Simon Law <sfllaw@debian.org> for the Debian system (but may be used by others). It is based on the docu- mentation provided by the original program. This manual is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. WMTIME 1.0b2 May 1998 WMTIME(1)
All times are GMT -4. The time now is 10:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy