10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have several line in a text file. for example
I like apple;
I like apple
I like orange;
Output: I like apple
I try to useif grep -q "!\;$"; then (Not work)
Please use CODE tags when displaying sample input, sample output, and code segments (as required by forum rules). (1 Reply)
Discussion started by: cmdcmd
1 Replies
2. Shell Programming and Scripting
Hi All,
I need one help to replace particular words in file based on if finds another words in that file .
i.e.
my self is peter@king.
i am staying at north sydney.
we all are peter@king.
How to replace peter to sham if it finds @king in any line of that file.
Please help me... (8 Replies)
Discussion started by: Rajib Podder
8 Replies
3. UNIX for Beginners Questions & Answers
im trying to search for a WORD in a file which
begins with a number
followed by a hypen
follwed multiple words
and end with a dot "."
and pront the entire line which matches the above.
Please note that there is a space at the begining of each line
i/p file
19458 00000-CONTROL-PARA.... (5 Replies)
Discussion started by: anijan
5 Replies
4. Shell Programming and Scripting
Hi all,
Is there other way to Add text at start and ending of every line?
here my script:
cat file.txt |awk '{print "<p align=\"justify\">"$0"</p>"}'
but the problem they put including white spaces, I only need those line have a sentence or text not an skip all have empty string or have... (7 Replies)
Discussion started by: lxdorney
7 Replies
5. UNIX for Dummies Questions & Answers
I have a group of files that I need to be sorted by number. I have tried to use the sort command without any luck.
ls includes*
includes1
includes10
includes11
includes12
includes2
includes3
includes4
includes5
includes6
includes7
includes8
includes9
I have tried ls includes*... (6 Replies)
Discussion started by: newbie2010
6 Replies
6. UNIX for Dummies Questions & Answers
i need to write a bash script that recive a list of varuables
kaka pele ronaldo beckham zidane messi rivaldo gerrard platini
i need the program to print the longest word of the list.
word in the output appears on a separate line and word order in the output is in the order Llachsicografi costs.... (1 Reply)
Discussion started by: yairpg
1 Replies
7. UNIX for Dummies Questions & Answers
I have a file that looks some like this:
I need to delete most of the information and sort the rest in such way that I get the following output file
Any help will be greatly appreciated (3 Replies)
Discussion started by: Xterra
3 Replies
8. Shell Programming and Scripting
Hi! I've a C file which consist of many function definitions with numbers at the beginning as shown below..
10 void search()
11 {
12 /*body
14 *
15 *
17 *
18 *
40 *
42 *
60 }
90 void func_name()
95 {
99 /*body
100 *
105 *
111 * (7 Replies)
Discussion started by: abk07
7 Replies
9. UNIX for Advanced & Expert Users
Hi List is
000|2008-07-17|556543|RTJ|35-RTGJ|EYT
465|2008-11-10|567789|GHJ|45-DGHH|ETU
533|2008-09-06|567789|GHJ|45-DGHH|ETU
How does it do it?
sort -t ':' +0 -1 -n +1 -2 +2 -3 -o list list (6 Replies)
Discussion started by: gurvinder
6 Replies
10. Shell Programming and Scripting
Hello masters.
I have a rather simple problem but its been killing me. I have a file "x" with only 1 line inside it. The line looks something like
Now this is only part of the line. Its actually about 4000 characters. What i need to do is whenever there is a "}", i need to append the next... (4 Replies)
Discussion started by: aismann
4 Replies