10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I wrote a shell script program that supposed to delete any directories and its files that begin with the same character string . The program is designed to delete directories and its files that are one day old or less and only the directories that begin with the same character string. The problem... (1 Reply)
Discussion started by: dellanicholson
1 Replies
2. UNIX for Beginners Questions & Answers
For example: I am grepping "Hello" from a file and there are 10 matches. So all ten lines with match will get stored into a variable($match). Now I want to ignore those lines which have "Hi" present in that.
Currently I tried this: match = grep "Hello" file | grep -v "Hi" file
But that's not... (2 Replies)
Discussion started by: pavan
2 Replies
3. Shell Programming and Scripting
I have two variables,
my $filename = "abc_yyyy_mm_dd.txt";
my $filename1 = " abc_2011_11_07.txt";
I need to perform some operations after checking if $filename has $filename1 in it
i have used the below code,
if($filename =~ /^$filename1/)
{
----
--
} (2 Replies)
Discussion started by: irudayaraj
2 Replies
4. Shell Programming and Scripting
variables are stored in this format
D0000, D12345, S1234, D12345 | KestrelPrdV2_0.build.177 - svn 141115 tag as V2.0.0.14
D0000, D12345, S1234, D12345
My question is how can I check the first character of each variable stored in array.It should be start with D or S.
Please help... (7 Replies)
Discussion started by: anuragpgtgerman
7 Replies
5. Shell Programming and Scripting
Hey Guys,
I have text such as this.
28003,ALCORN,2
28009,BENTON,2
28013,CALHOUN,2
28017,CHICKASAW,2
47017,CARROLL,2
05021,CLAY,0
The last digit after the final "," is a variable value. This is the base file. I have to do further execution on this file later and I need to update the... (7 Replies)
Discussion started by: chagan02
7 Replies
6. Shell Programming and Scripting
Hi all,
Does anyone know how to code in ksh that will remove the first character in a string variable and replace that variable without the first character?
Example:
var1=ktest1 will become var1=test1
var2=rtest2 will become var2=test2
Need help please. (10 Replies)
Discussion started by: ryukishin_17
10 Replies
7. Shell Programming and Scripting
Hello all,
I have a file containing the following
p1 q1 p2 q2 p1 p2 p3
pr1 pr2 pr1 pr2
pa1 pa2
I want to remove the last character from all strings that start with 'p' and end with '1'. In general, I do not know what is between the first part of the string and the last part of the string.... (4 Replies)
Discussion started by: bigfoot
4 Replies
8. Shell Programming and Scripting
I would like to remove characters from column 7 so that from an input file looking like this:
>HWI-EAS422_12:4:1:69:89 GGTTTAAATATTGCACAAAAGGTATAGAGCGT U0 1 0 0 ref_chr8.fa 6527777 F DD
I get something like that in an output file:
... (13 Replies)
Discussion started by: matlavmac
13 Replies
9. Shell Programming and Scripting
Hi all,
I want to search for a data type in a line.For this in a loop i am checking for $DATA_TYPE in a line using grep.But grep is not able to find when i give this.
Can any one tell me how to check string in $DATA_TYPE variable in line usign grep (or) any other way to do the above task.
... (4 Replies)
Discussion started by: jisha
4 Replies
10. UNIX for Dummies Questions & Answers
Hi ! All,
I have to delete first 2 characters from string. How its possible?
Like string value is "2001". I required output as "01"
Plaese help me.
Nitin (4 Replies)
Discussion started by: nitinshinde
4 Replies