10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have two files blocks.txt and rules.txt. In blocks.txt i have the following entries
Linux1
Linux2
Linux3
.....
Linux10
In rules.txt i have the lines where a filename pattern starts like
'blk-name.*'
I want to replace 'blk-name' with the names read from blocks.txt file
I tried... (2 Replies)
Discussion started by: Jag02
2 Replies
2. Shell Programming and Scripting
hii please help me this is the script
num=$1
sum=0
while
do
x=`expr $num % 10`
sum=`expr $sum + $x`
num=`expr $num / 10`
done
echo "Summation is $sum"
it is giving error
pratyush@ubuntu:~$ sh shell.sh 123
shell.sh: 11: 123: not found
Summation is 0 (3 Replies)
Discussion started by: Pratyush Sakhle
3 Replies
3. Shell Programming and Scripting
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies
4. Shell Programming and Scripting
Hello,
I have a file with a 1000 ids in the form of strings. I want to replace each id with a unique numbers in the whole file. each id is repeating in all the columns. I know I can use sed command but there are many ids in file which are need to be converted
example of input file
B752... (4 Replies)
Discussion started by: ryan9011
4 Replies
5. UNIX for Dummies Questions & Answers
I have value like ABCDEF,BBCCDD in a shell variable, now i would like to have ABQWEF,BBQWDD in the same shell variable. How can i replace the char at position 3&4 with QW in shell script? (3 Replies)
Discussion started by: vel4ever
3 Replies
6. Shell Programming and Scripting
hello everyone
my file contains many records, the following is a sample:
BEGIN
ASX1500000050002010120000000308450201012000177
ASX1100002000000201012000000038450201012000220
ASX1600100005000201012000000038450020101200177
ASX1900100006000201067000000058450020101200177... (2 Replies)
Discussion started by: neemoze
2 Replies
7. Shell Programming and Scripting
Hello every1,
I need help to replace a string in a file by my bash script.
Find: log4j.appender.toLogFile.layout.ConversionPattern= %d %5p (%F:%L) - %m%n= %d %5p (%F:%L) - %m%n
Replace: log4j.appender.toLogFile.layout.ConversionPattern= %d %5p (%F:%L) - %m%n
I tried by sed, but kept... (7 Replies)
Discussion started by: titanic4u
7 Replies
8. UNIX for Dummies Questions & Answers
hey,
I have a file with numbers in US notation (1,000,000.00) as well as european notation (1.000.000,00)
i want all the numbers to be in european notation.
the numbers are in a text file, so to prevent that the regex also changes the commas in a sentence/text i thought of:
sed 's/,/\./'... (2 Replies)
Discussion started by: FOBoy
2 Replies
9. Shell Programming and Scripting
Hi Can someone help me with this one?
I have string..
(PROC_PROC_ID == 12183) <--PID is dynamic
and i want to replace the PID number with whatever PID from
/opt/hpws/apache32_2/logs/httpd.pid file.
i'm having problem since the PID on the string is dynamic. It may be 2-5 digits or more.
... (5 Replies)
Discussion started by: ryandegreat25
5 Replies
10. Shell Programming and Scripting
I have written down a simple perl program to replace a string from a word file. My script does'nt seem to work. Any pointers to make it work will be appreciated. The code is given below.
#!/usr/bin/perl
while (<>) {
open(FILE,$_);
while (<FILE>) {
s/This/I did it/g;
}... (6 Replies)
Discussion started by: MobileUser
6 Replies