10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi All ,
I am having a large file with lots of modules as shown below
###############################################
module KKK
kksd
kskks
jsn;lsm
jsnlsn;
Ring
jjsjsj
kskmsm
jjs
endmodule
module llll
1kksd11
k232skks
j33sn;l55sm (6 Replies)
Discussion started by: kshitij
6 Replies
2. UNIX for Advanced & Expert Users
Hello All,
I'm trying to extract the lines between two consecutive elements of an array from a file.
My array looks like:
problem_arr=(PRS111 PRS213 PRS234)
j=0
while } ]
do
k=`expr $j + 1`
sed -n "/${problem_arr}/,/${problem_arr}/p" problemid.txt
---some operation goes... (11 Replies)
Discussion started by: InduInduIndu
11 Replies
3. UNIX for Dummies Questions & Answers
Dear All,
I am trying to sort an array of numbers to retrieve the mimimum and maximum values of numbers in that array, by printing the first and last elements of the sorted array. My code is @sorted_numbers = sort (@numbers);
print "@sorted_numbers\n";
print "$sorted_numbers,... (0 Replies)
Discussion started by: pawannoel
0 Replies
4. Shell Programming and Scripting
CA_RELEASE has a value of 6. I need to check if that this is a numeric value. if not error.
source $CA_VERSION_DATA
if * ]
then
echo "CA_RELESE $CA_RELEASE is invalid"
exit -1
fi
+ source /etc/ncgl/ca_version_data
++ CA_PRODUCT_ID=samxts
++ CA_RELEASE=6
++ CA_WEEK_NO=7
++... (3 Replies)
Discussion started by: ketkee1985
3 Replies
5. Shell Programming and Scripting
Hello,
I want to print a number of lines of a file after a specific expression of a line.
I have this sed command but it prints only 1 line after the expression.
How could I adapt it to print for instance 10 lines after or 15 lines after ?
sed -n '/regexp/{n;p;}'
Thx & Regs,
Rany. (5 Replies)
Discussion started by: rany1
5 Replies
6. Shell Programming and Scripting
Hey, I found a way to print the lines which is just before a regular expression, not including the expression.
sed -n '/regexp/{n;p;}' myfile
Now I'm looking for a way to print all lines, exept the regular expression and also the line before the same regular expression.
Use code tags. (1 Reply)
Discussion started by: Livio
1 Replies
7. UNIX for Advanced & Expert Users
Hi
Is there any unix shell command or utility to know if the file is sorted or not?
Thanks (3 Replies)
Discussion started by: ksailesh
3 Replies
8. Shell Programming and Scripting
Hi -
I am guessing this is fairly simple for someone .. but I can not quite figure it out. I need a sed command to print just parts of lines from a file.
e.g. filea.txt
4710451 : Success : MODIFY : cn=user1,dc=org,dc=uk
Message log started
Message log ended
4710452 : Success : MODIFY :... (7 Replies)
Discussion started by: sniper57
7 Replies
9. Programming
I had seen this error for the first time .....
error: initializer expression list treated as compound expression
please help.... (12 Replies)
Discussion started by: arunchaudhary19
12 Replies
10. Shell Programming and Scripting
Hi,
I am trying to make a script that creates a list of all active (alive) processes sorted by size and then print this list on screen.
Could anyone help me?
Thaks a lot (7 Replies)
Discussion started by: pro
7 Replies