10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I've data like these:
Gene1,Gene2 snp1
Gene3 snp2
Gene4 snp3
I'd like to split line if comma and then print remaining information for the respective gene.
My code:
awk '{
if($1 ~ /,/){
n = split($0, t, ",") (7 Replies)
Discussion started by: genome
7 Replies
2. Shell Programming and Scripting
Hello Folks,
Need to bisect strings based on a subset.
Below works good.
echo /a/b/c/d | awk -F"/c/d$" '{print $1}'
/a/b
However, it goes awry with special characters.
echo /a/b/c+/d | awk -F"/c+/d$" '{print $1}'
/a/b/c+/d
Desired output:
/a/b
Escaping the special characters... (11 Replies)
Discussion started by: vibhor_agarwali
11 Replies
3. Shell Programming and Scripting
This is really frustrating because I can't figure it out.
I'm running a health check script. One of the items I'm checking is the amount of memory on a server. I use the free command, which outputs something like this (excerpt)
Mem: 100 100 100 100
Swap: 100 100 100 100
In my debugging... (5 Replies)
Discussion started by: JustaDude
5 Replies
4. Shell Programming and Scripting
Hi All,
select app from the menu: ABC DEF GHI JKL ALL # ALL will select all the apps in the menu echo "Enter your option" read option; if then <execute the below command> elif # option is the 1 selection from menu...not ALL <execute the below command> else echo wrong... (6 Replies)
Discussion started by: Devaraj A
6 Replies
5. Shell Programming and Scripting
I have the foolowing data file:
File1
<p name="A">5004</p>
<p name="B">5004</p>
<p name="C">5004</p>
<p name="A">15004</p>
<p name="B">15004</p>
<p name="C">15004</p>
In a while loop using sed (100 of line need to be replace), I need the output to File3:... (2 Replies)
Discussion started by: bobo
2 Replies
6. Shell Programming and Scripting
I have a file like this:
AAEQGAGNQPQH,,,,160,32,,,,
AAGQDYNSPLH,,712,39,,,,,,
AAGREGGNTEAF,26,,,,,,,,4
AAGSPQH,,,,8,5,,,,
AAKKLGQFYNEQF,4,,6,,,7,,,2
AANSGGRYNEQF,,2747,3120,,,,,,
AAQGGVGGELF,,,,5,,12,36,,
AAQGLAGYYEQY,,25,13,,,,,,
AAQRGNEQF,510,2,,,6,,6,,76
AAQTGENSPLH,,16,16,,,,,,
The... (9 Replies)
Discussion started by: xshang
9 Replies
7. Shell Programming and Scripting
Hi all,
How do I extract a value without special characters? I need to extract the value of %Used from below and if its greater than 80, need to send a notification.
I am doing this right now..Its giving 17%..Is there a way to extract the value and assign it to a variable in one step?
df |grep... (3 Replies)
Discussion started by: sam_78_nyc
3 Replies
8. UNIX for Dummies Questions & Answers
We have a unix file that contains special characters (ie. Ñ, °, É, ¿ , £ , ø ). When I try to read this file I get a codepage error and the characters are replaced by the # symbol. How do I keep the special characters from being read?
Thanks.
Ryan (3 Replies)
Discussion started by: Ryan2786
3 Replies
9. Shell Programming and Scripting
I have a file that evidently has some special characters in it. Is there a Unix command that I can use tp display the file so I can see the octal or hex values? (2 Replies)
Discussion started by: BCarlson
2 Replies
10. Shell Programming and Scripting
i have this script that searches for a pattern.
However it fails if the pattern includes some
special characters. So far, it fails with the
following strings:
1. -Cr
2. $Mj
3. H'412
would a sed or awk be more effective?
i don't want the users to put the (\)
during the search (they... (5 Replies)
Discussion started by: apalex
5 Replies