10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hello All,
I want to print data in between two lines in a file sample.txt through more or cat command on the screen. For that I am using below sed command to give the BEGIN and END text.
Content of sample.txt
server01:~ # cat /proc/mdstat
Hello this is a text message 1
Hello this is a... (5 Replies)
Discussion started by: Xtreme
5 Replies
2. Linux
Hi,
Could you please provide me command to filter contents between date in a log file?
Say for example, in a log file I want to capture contents between date May 01 from 5am to 9 am.
OS -- Linux
Regards,
Maddy (1 Reply)
Discussion started by: Maddy123
1 Replies
3. Shell Programming and Scripting
HTML Code:
archive_history() { HISTORYOLD=${HISTFILE}.archive CURTIME=`date` CURTTY=`tty` IP=$(echo $SSH_CLIENT | awk '{print $1}') if ; then echo "#-${HOSTNAME}-- ${CURBASHDATE} - ${CURTIME} ($CURTTY) ${USER} ${IP}----" >> $HISTORYOLD history... (0 Replies)
Discussion started by: rehantayyab82
0 Replies
4. Shell Programming and Scripting
HTML Code
archive_history() { HISTORYOLD=${HISTFILE}.archive CURTIME=`date` CURTTY=`tty` IP=$(echo $SSH_CLIENT | awk '{print $1}') if ; then echo "#-${HOSTNAME}-- ${CURBASHDATE} - ${CURTIME} ($CURTTY) ${USER} ${IP}----" >> $HISTORYOLD history... (2 Replies)
Discussion started by: rehantayyab82
2 Replies
5. Shell Programming and Scripting
Hi,
I am using the following command(sed) to get the key/value pair from the string
String="{ "test":"test message", "testmessage":"subscription is active, charge successfully} " }"
status=$( echo $String | sed -e 's/^.*\("testmessage":*\).*$/\1/')
echo $status
i am getting this... (2 Replies)
Discussion started by: nanthagopal
2 Replies
6. Shell Programming and Scripting
Hi
My OS is solaris 64 bit 10, I have many files in a logs directory where we recive 40-50 logs every day. i have last 20 days file present in this directory. I want to move each day file to a particulaar directory whose name is appended with the date of file.
eg
Code:
1.txt file... (1 Reply)
Discussion started by: guddu_12
1 Replies
7. Shell Programming and Scripting
Hi
I need to find the list of files in a directory and to do some specific operations based on the type of files.
suppose in a directory am having .dat , .log, .err, .rej file types. i need to filter out .dat and .log only which are older than six months.
i used the below query but the... (2 Replies)
Discussion started by: msathees
2 Replies
8. Shell Programming and Scripting
Hi All,
I want to extract last modified, seen in ls -l command, of a file and then convert it into "YYYYMMDD" format.
Any help regarding would be helpful
Thanks in advance... (3 Replies)
Discussion started by: itsme_maverick
3 Replies
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
Hi,
I am new to using Sed. I have a file containg lines like the following:
INFORM----Test.pc:168:10/11/05 12:34:26 > some text goes here..
TRACE-----Test.pc:197:10/11/05 12:34:26 > some text goes here..
My requirement is to replace 10/11/05 12:34:26 with a string <RUNDATE> (including <... (4 Replies)
Discussion started by: Hema_M
4 Replies