How to put dot in timestap?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to put dot in timestap?
# 1  
Old 03-03-2017
How to put dot in timestap?

I have a string:
Code
time=20170303122334

I need the result:

20170303.122334

I did:
CODE:
ttdotss=`echo ${time} |sed 's\(.|{8\}\)/|1 /g'`

Result
sed: Function s\(.|{8\}\)/|1 /g cannot be parsed.
Could you please help me to resolve this issue?

Thanks for contribution

Last edited by digioleg54; 03-03-2017 at 03:13 PM.. Reason: take off what is not need
# 2  
Old 03-03-2017
no need to multiple threads.
Mods, please merge/close....
# 3  
Old 03-03-2017
Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

This thread is closed.

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Mv or cp with a . (dot)?

How can I rename a file with a . prefix? I actually need to copy the file but the . seems to be very tough to do. mv ./bla ../fa/la/.bla - doesn't work. I've tried all sorts of bracketing and that doesn't work. Maybe the only way to do it would be to name the file _.bla then rename it... (19 Replies)
Discussion started by: scribling
19 Replies

2. Shell Programming and Scripting

How to split timestamp and put a dot between YYYYMMDD and HHMMSS?

I have a string time=20170303201234 I want to split it and put a dot result: 20170303.201234 CODE: ttdotss=`echo ${time} | {8}.{8}` Doesn't understand I tried this: CODE: ttdotss=`echo ${time} |cut -c 1-8 | . | cut -c 9-14` Result: script: .: argument expected... (4 Replies)
Discussion started by: digioleg54
4 Replies

3. Shell Programming and Scripting

Adding timestap to filename using perl

Hello, I am trying to create a file in windows and i want the filename to have timestamp as well but something is wrong and i can not understand waht. The code that i use is the following ($cwkday,$cmonth,$cday,$ctime,$cyear) = split(/\s+/, localtime); $current_date =... (5 Replies)
Discussion started by: chriss_58
5 Replies

4. Programming

How to put dot(.) in a string in C?

Hi all, Can anybody please tell me how can I put dot(.) in a string using C programming. for example -- I am having string "10111988" and I want to convert it as "10.11.1988" I will appriciate and thanks in advance.. (4 Replies)
Discussion started by: smartgupta
4 Replies

5. Shell Programming and Scripting

How to Removing a dot from a file name?

I need a script that will allow me to rename all of my files in subdir /FilesIn as follows: From kumc_835_111200.RMT.dat to kumc_835_111200RMT.dat kumc_835_111200.KMR.dat to kumc_835_111200KMR.dat .................etc How do I do that whithout doing a sed ... (10 Replies)
Discussion started by: mrn6430
10 Replies

6. Shell Programming and Scripting

Greping numbers with dot in it

Hi, I wanted to create a script what would take two numbers out of two files and add them together, but I got stuck with greping numbers what have a dot in it. So far I have grepped the two lines what include the numbers I need (from both files) to a third file and from that file I try to... (7 Replies)
Discussion started by: mario8eren
7 Replies

7. UNIX for Dummies Questions & Answers

variable name with dot(.)

Hi, Is it possible to declare variable with name having dot(.) in it ? something like gs.test='HELLO' Thanks in advance :) (1 Reply)
Discussion started by: gopalss
1 Replies

8. Shell Programming and Scripting

Replacing dot for comma

I wanted to change 34.66 to 34,66. I tried the command: sed 's/./,/' $NUM Where $NUM is a variable with 34.66 value. The output is ,4.66 (2 Replies)
Discussion started by: bdalmeida
2 Replies

9. Shell Programming and Scripting

dot files

Hi, everyone. I'm now using rsync command, and please tell me what is the wildcard for below looks like. I want to chose dotfiles, such as .ipod .apple but i don't want to chose . and .. ------------------ .* doesn't work, of course. Thanks, Euler04 (2 Replies)
Discussion started by: Euler04
2 Replies
Login or Register to Ask a Question