10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
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 (2 Replies)
Discussion started by: digioleg54
2 Replies
3. Shell Programming and Scripting
Hello.
I would like to search exactly "string1.string2.string3" and replace it by "new_string1.new_string2.new_string3"
And
I would like to search exactly "string2.string3" and replace it by "new_string2.new_string3"
And
I would not found in the result : "string1.new_string2.new_string3"... (3 Replies)
Discussion started by: jcdole
3 Replies
4. Shell Programming and Scripting
Hello,
I need to put the following string to the beginning of a file - but it should not create a newline at the end of the string.
So, the file I have is a compressed one - with gzip.
And I would like to add an ASCII-String to the beginning of the file. The string has a length of 69... (5 Replies)
Discussion started by: API
5 Replies
5. Shell Programming and Scripting
I have several file as below, and i want to put .txt to specific text contain ^main=EXE^cmd=run script /usr/prog/bd_,
file1
7.9102 12.1528 16.3672 7.4002
^main=EXE^cmd=run script /usr/prog/bd_123^"
line 16.3672 7.3134 17.8711 6.0981
file 2
7.9102 12.1528 16.3672 7.4002 ... (8 Replies)
Discussion started by: zulabc
8 Replies
6. Shell Programming and Scripting
I've a problem to put .h end of the line..below my input file
fg_a
bb
fg_b
bb
fg_c
bb
fg_d
aa
fg_f
ee
and i want the output file as below
fg_a.h
bb
fg_b.h
bb
fg_c.h
bb
fg_d.h (6 Replies)
Discussion started by: zulabc
6 Replies
7. Shell Programming and Scripting
hello,
I am writting a regular expression that intend to match any tunnel or serial interface but it doesn't mtach any serial sub-interface.
For example, statement should match "Tunnel3" or "Serial0/1" but shouldn't match "Serial0\1.1" (doesn't include dot ".")
I tried the following but... (3 Replies)
Discussion started by: ahmed_zaher
3 Replies
8. Shell Programming and Scripting
Hi,
I have a file (sample.txt) this file contains below text.
./au
./11.5.0
./11.5.0/admin
./11.5.0/admin/driver
./po
./11.5.0
./11.5.0/admin
./11.5.0/admin/driver
./xxsbx/11.5.0/java/src
./xxsbx/11.5.0/lib
./xxsel
./xxsel/11.5.0
./xxsel/11.5.0/admin
./zfa
./zfa/11.5.0... (2 Replies)
Discussion started by: gagan4599
2 Replies
9. Shell Programming and Scripting
Now I have a list of numbers in hand and I try to put the numbers into two columns. Can I do this work with any script? Great thanks to your help!
1A1.log
HF=-240.451527
HF=-240.5213996
1A2.log
HF=-240.451527
HF=-240.5213996
1B.log
HF=-240.4273718
HF=-240.4956636
1C.log... (7 Replies)
Discussion started by: liuzhencc
7 Replies
10. Shell Programming and Scripting
hi all!
i have a working that looks like this...
file1
MALE JOHN
MALE ANJO
FEMALE ANNE
MALE JAMES
FEMALE HONEY
FEMALE IZA
what i want to do is insert "M" when the first string is "MALE" and insert "F" when the first string is "FEMALE".
file1
M MALE ... (10 Replies)
Discussion started by: kingpeejay
10 Replies