10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
In my bash script I want to add a code which remove all entries older than x days.
To simplify this problem, I have divided into 3 parts. (2 parts are done looking answer for 3rd part.)
To find the latest log date - Done
Latest_Time=`find . -name '*.tps' -exec sed '/endTime/!d; s/{//;... (3 Replies)
Discussion started by: Agoyals1986
3 Replies
2. Linux
I have a file that looks like this:
DIP-27772N DIP-18408N refseq:NP_523941
DIP-23436N|refseq:NP_536784 DIP-23130N|refseq:NP_652017
DIP-22958N|refseq:NP_651195 DIP-20072N|refseq:NP_724597
DIP-22928N|refseq:NP_569972 DIP-22042N|refseq:NP_536744|uniprotkb:P54622... (4 Replies)
Discussion started by: Syeda Sumayya
4 Replies
3. Shell Programming and Scripting
Hi im trying to add numbers, got no problem with it im using awk '{s+=$1} END {print s, "MB"}',
but what if the numbers are like mention below. who will i add them
2000 KB
1 MB
Answer: 2001
Desired:
2000 KB
1 MB
Answer: 3000 (4 Replies)
Discussion started by: invinzin21
4 Replies
4. Shell Programming and Scripting
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies
5. Shell Programming and Scripting
Hi,
I am trying to remove lines once a string is found till another string is found including the start string and end string. I want to basically grab all the lines starting with color (closing bracket). PS: The line after the closing bracket for color could be anything (currently 'more').... (1 Reply)
Discussion started by: Dabheeruz
1 Replies
6. Shell Programming and Scripting
Hi there, im sure this is really simple but i have some strings like this
e1000g123001
e1000g0
nge11101
nge3and i want to create two variables ($DRIVER and $INSTANCE). the first one containing the alpha characters that make up the first part of the string, e.g. e1000g or nge and the... (9 Replies)
Discussion started by: rethink
9 Replies
7. Shell Programming and Scripting
Hi
i had String like
UID: ABC345QWE678GFK345SA90, LENGTH 32
when I used awk ' FS, {print $1}' prints
ABC345QWE678GFK345SA90,
how can i getrid of that coma at the end of the string.
Thanks in advance.. (14 Replies)
Discussion started by: Reddy482
14 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I'm struggling with a regex that would match a 'b' that follows an 'a' and is at the end of a string of non-white characters. For example:
Line 1: aba abab b abb aab bab baa
I can find the right strings but I'm lacking knowledge of how to "discard" the bits that precede bs.... (2 Replies)
Discussion started by: machinogodzilla
2 Replies
9. Shell Programming and Scripting
Hey guys, Can sed or another command be used to examine a path such as
/home/test/blah/blahand check to see if the last character is a "/" and if so remove it
So this is what should happen:
/home/test/blah/blahnothing happens, this is ok
/home/test/blah/blah/the "/" at the end is... (6 Replies)
Discussion started by: tret
6 Replies
10. Shell Programming and Scripting
Hello friends,
I want to remove blank spaces at the end of lines. I use sed command to do this but it is not working correctly.
sed ‘s/ $//’ file_name
Can some body tell me what is the proper way to remove blank spaces at the end of a limes.
Thanks,
Mahesh Fernando. (3 Replies)
Discussion started by: maheshsri
3 Replies