General :: Awk: Awking The Right Separator With Slashes - Colons - Commas (date Time And Data)

Jan 4, 2011

I wrote a hack script that outputs the following every so often: Code: 01/04/11 10:33:02: 97,1413,1447,2860 I must leave the data format the same --but I want a special number from it. In this case it's 97 and it's always going to be the first in the 4 columns of comma delimited items. I can extract with this:

Code: cat datafile | awk -F" " {'print $3'} | awk -F"," {'print $1'} But that's really sloppy. Can someone point out a better way of doing this (with awk) and tell me why?

View 3 Replies


ADVERTISEMENT

General :: Search A String Having Spaces / Slashes / Colons In Vi Editor

Feb 2, 2010

I need to seach a string containing

the substring of 'New Request object:'

and

the substring of '/0x2ab46b1f90' in vi editor,

how do I accomplish that?

View 7 Replies View Related

General :: Search & Replace Back Slashes To Forward Slashes In Windows

Feb 11, 2011

Lately I've been needing to delete new untracked files from my versioning system. Being in linux I use: hg status -un|xargs rm And it works nice, but when doing it in windows, hg status lists paths with backslash so that is where stuff goes wrong. So then I try: hg status -un|sed 's/\///g' ...but I get the error: sed: -e expression #1, char 8: unterminated `s' command

Then I try some ascii: `hg status -un|sed 's/o134/o57/g'`...that gets me: sed: -e expression #1, char 14: Trailing backslash And some scripting: hg status -un|sed 's/`echo `/`echo /`/g' ...that gets me: sed: -e expression #1, char 19: unknown option to `s'

I try all the last with any other characters and I get the expected output... so I'm completely lost. I have cygwin, of course, and I want to avoid using a file (that is what I've been doing).

View 2 Replies View Related

Programming :: Replacing "slashes" With Back Slashes - Escape Character ?

Jan 7, 2011

Usually if I have to replace a character in a string I used the sed /s/ command. However, I am having some difficulty in doing the same thing when I have the following string in a variable in my shell script and I need to replace all the forward slashes ("/") to backslashes ("").

For example, this is what I am doing:

Code:

Not sure how to escape the slashes in this case.

View 2 Replies View Related

General :: Date - How To Set Current Time

Jun 26, 2011

Why is the output of the following commands different?

root@vmi2115:/var# hwclock
Sun 26 Jun 2011 01:21:38 PM CEST -0.273230 seconds
root@vmi2495:/var# date
Sun Jun 26 15:21:39 CEST 2011
root@vmi2115:/var#

And can I change the current time on Linux?

View 4 Replies View Related

General :: Rpm -qa --last Lists All Rpm With Date And Time?

Oct 4, 2010

rpm -qa --last lists all rpm with date and time. But I want to sort the list by date, with earlier rpm displayed first. So it needs pipe, rpm -qa --last |

View 2 Replies View Related

General :: Date And Time Of A Process When It Was Started?

Mar 19, 2010

Centos 5.4 64bitWould like to know when a particular process was started.1.Quote:ll -d /proc/4014/dr-xr-xr-x 5 mysql mysql 0 Nov 28 07:34 /proc/4014/2.Quote:ps -o pid,lstart -p 4014 PIDSTARTED 4014 Tue Nov 17 23:10:13 20091) Which one should I consider?2) why do both have such a difference?

View 1 Replies View Related

General :: Extracting Date And Time From The At Command?

Sep 10, 2009

I would appreciate help with how to extract the date and time from at command jobs. From what I can tell, the date and time is embedded in the file name (/var/spool/atjobs).I'd be using this information in a (bash) shell script.

View 14 Replies View Related

General :: Set Date Time Using A File Content?

Jan 13, 2010

I have a file called foo with a date string in it - and nothing else in the file

2010.01.13-22:28:28

I want to send this file content to date -s command so I can modify using a cron job.

I tried several ways to pipe the file contents to date command but did not work.

View 4 Replies View Related

General :: Time And Date Deleted / Reinstall It?

Mar 16, 2011

I am using Ubuntu 10.4 and by mistake I deleted time and date. How do I reinstall?

View 2 Replies View Related

General :: Uptime - Getting Date & Time Of System Startup?

Mar 28, 2011

I know that uptime prints the time a machine has been up and running, but is there an easier (reliable) way to get the date of the start up than counting down from this output?I tried looking around /proc, but didn't find anything of relevance. There's also a line like this on my dmesg: [ 0.673492] rtc_cmos rtc_cmos: setting system clock to 2011-03-14 14:26:52 UTC (1300112812), but I'm wondering if this method is distribution and kernel version agnostic.

View 5 Replies View Related

General :: How To Set Debian To Automatically Update Time And Date

Aug 14, 2011

I have an old computer and BIOS counts the time slower than real. So, how can I set my OS to update the time automatically using the internet? If it updated the time only during booting, it would be enough.

View 2 Replies View Related

Fedora :: Network Time Protocol Part Of Date / Time Settings

Oct 3, 2009

I've got fedora 11 set up to use network time protocol to sync my laptop's date & time when I'm on-line. The question is simple really, I've added a local universality's time server (what is public) and it's live. but it's added to the end of the default time servers what come with fedora. How do I get fedora to just use the local time server, is it a case of removing the default time servers for fedora, but there is a box what says advanced options which are. sync system clock before starting service ???? & use Local time source (( is that the same as the local ntp server that I've got set up ))Hope some body can help me with the network time protocol part of Date/Time settings.

View 9 Replies View Related

General :: Task Manager - Setting Time / Date Do Not Work?

Feb 19, 2010

I tried googling but couldnt find the task manager equivalent? Just want to find out how much memory LINUX uses in general as I have been using it for few days and everything seems faster than on vista with no programs freezing! Also on my taskbar, when I click on the time to change it, it doesn't work? I think the timezone is set to US or something but how do i change the timezone?

View 2 Replies View Related

General :: Script To Display Modified Date&time Of Files?

May 31, 2010

I am using the following script to creates list of accessed files.I like to add modified date and time of accessed files in the output.

For this what needs to be added in the below script??

#!/bin/bash
#
# creates list of accessed files
#
set $(date)
find /hdc160GB/programmers/projects -cmin -1440 > /hdc160GB/programmers/data/fileschanged/alert_$6-$2-$3.txt

View 7 Replies View Related

General :: Log The Start/completion - Time&date - Of My Cron Job Script?

Jan 11, 2010

How do i log the start/completion (time&date) of my cron job script? i want to be able to see what time it started and what time it finished? and if there where any errors while running my script.

View 3 Replies View Related

General :: Date And Time Disappeared From Upper Right Hand Corner

Jun 26, 2010

I used to have the date and time in the upper right hand corner and then yesterday morning it was just gone. I can't figure out how to get it back up there. I've looked everywhere I thought it would be to put it back on there and I've had no such luck.

View 2 Replies View Related

Ubuntu :: Set Time To Singapore Server With Time And Date?

Oct 28, 2010

I want to synchronize my time to a time server in Singapore. How can i do so with the Time and Date in System - Administration - Time and Date?

View 4 Replies View Related

Red Hat / Fedora :: Date And Time Changing All Time / Solution For It?

Jan 11, 2010

I have a problem..
the Date and time are changing all the time...

Meanwhile, I'm set the clock every day, But I must find a solution ... Do you have a solution?

View 1 Replies View Related

General :: Find A Proper Command To Move A Certain Set Of Files According To Date/time Range?

Mar 18, 2009

I'm trying to find a proper command to move a certain set of files according to date/time range. I am thinking that the command should be something like:

Code:
ls -l | grep 'date/time range' | mv /folder

View 6 Replies View Related

General :: Weird Commas In My /etc/password File - Remove Them?

Sep 7, 2011

There are weird commas after the real-name parameter of some lines in my /etc/password file.

kye:x:1000:100:Kye,,,:/home/kye:/bin/bash

What gives? Why are they there? Can I remove them?

View 1 Replies View Related

General :: Sed - Append Four Commas ',,,,' At The End Of Lines Containing The Pattern 'Response' In A Text File

Nov 5, 2010

Using sed, I am trying to append four commas ',,,,' at the end of lines containing the pattern 'Response' in a text file with lines such as these:

6,Pulse,50,254968,14886,NA,,,,
7,Picture,8,265157,0,1,15045,2,0,15000
7,Response,1,271553,6396,1
7,Pulse,50,274969,9812,NA,,,,
8,Picture,1,290232,0,1,15045,2,0,15000
8,Pulse,50,294969,4737,NA,,,,
[Code].....

View 1 Replies View Related

General :: Count Words With Comma As Separator?

Feb 16, 2010

I'm trying to count words in a text file that has a comma as separator. I know that I must user wc -w, but wc uses space as a separator

View 2 Replies View Related

General :: Scripting To Convert DOS To UNIX Style Slashes

Dec 17, 2010

Write a script to convert all DOS style backslashes to UNIX style slashes in a list of files

View 2 Replies View Related

General :: Change A Files Modification Date "only" Without Changing The Time?

Oct 29, 2010

I'd like to change a files modification date "only" without changing the time. I'm aware of the 'touch' command but is seems like it only allows changing both the date and time, and not one of them. Any ideas on an easy way to change a file's modification date without also changing its time? (I have a long list of files and thus would like to run one to command to change them all)Example: Change a file's (month) timestamp from "2010-09-23 11:59:23" to "2010-10-23 11:59:23"Background: I accidentally set the wrong month on my camera and ended up with all photos having a modification timestamp with the wrong month.

View 3 Replies View Related

General :: Parsing File Dates - Get The Date Of The Last Time A File Was Modified ?

Jan 11, 2010

I need to get the modified date on a file in linux to use in a script.I tried using 'ls -l' on the file, but this caused problems when the date turned from a single digit into a double. The reason for the problem was because I was parsing the result string on spaces.How can I get the date of the last time a file was modified so I can use it in a script? For example, if a file was modified on 1/11/2010, I need the 11.

View 2 Replies View Related

General :: Print Separator For All Fields In `join` Utility?

Dec 13, 2010

For example: file a:Tom:blackLily:pinkfile b:Tom:bigKate:smallAnd, the result:join -t: a1 a ot:Tom:black:bigLily:pinkBut what I want is:Tom:black:bigLily::pink

View 2 Replies View Related

General :: Error Missing Separator When Compiling - Make

Nov 16, 2010

I have problem with compiling server... I finish ./configure without any problem, and now, when I write make, I see that: Quote: Makefile:360: *** missing separator. Stop. I read something, and know, that error shows when there are problem with spaces. And I should use there a tab. On line 360 I have:

Code: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/account.Po@am__quote@ I try to change this one space inside to tab, but that doesnt work for me... Terminal always show error in the same line.

View 2 Replies View Related

General :: Setting Time And Date / Setting Calendar Format?

May 14, 2010

Have installed Suse 11.2. how can I change the calendar format dd/mm/yyyy and how to configure the system to sync.from an ntp?

View 1 Replies View Related

General :: Script To Find Files By Data And Time?

Aug 6, 2010

We have a script that FTP files 3 times a day, once ant 02:30, 04:00 and 13:00. Once the process runs it puts a copy of the file sent in the processed folder. What I'm trying to do is check to see if the files are there and if not send an alert /email. The file names are IVF_20100806_*.150, PLAZ_ 20100806_*.151, TRAN_20100806_*.152 and TRAN_20100806_*.151

This is what I have

#!/bin/ksh
#
. ${HOME}/.bash_profile
check_file()
{

[Code].....

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved