10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Friends,
I have more than 1000 lines in text file which needs to be converted as UPPERCASE by adding _
com.sun.url=www.sun.com
com.ssl.port=808
com.ui.path=/apps/ssi
Expected output
com.sun.url=_COM.SUN.URL_
com.ssl.port=_COM.SSL.PORT_
com.ui.path=_COM.UI.PATH_
Thanks in... (4 Replies)
Discussion started by: baluchen
4 Replies
2. Shell Programming and Scripting
Hi all
This is my first post. Please bear with me with all my mistakes. I started learning shell since couple of days now and this might be quite basic for all, i want to search for files in a directory containing specific string and replace it with new string. The code i wrote is quite bulky... (2 Replies)
Discussion started by: theprogrammer
2 Replies
3. UNIX for Dummies Questions & Answers
Hey Guys, im looking for a script that will work under OSX.
What i want to do is copy information from one file (Specific LIne) and write it to a certain line in another. To be more specific...
I want the hostname of a mac to be gathered ( i assume its stored in a .plist file somewhere) and... (2 Replies)
Discussion started by: padgo
2 Replies
4. Shell Programming and Scripting
Hello Folks,
#!/usr/bin/perl
use File::Find;
open F,shift or die $!;
my %ip=map/(\S+)\s+(\S+)/,<F>;
close F;
find sub{
if( -f ){
local @ARGV=($_);
local $^I="";
while( <> ){
!/#/ && s/(\w+)\.fs\.rich\.us/$ip{$1}/g;
print;
}
}... (8 Replies)
Discussion started by: richsark
8 Replies
5. Shell Programming and Scripting
Dear all
I need a script for multiple find and replace in a single file.
For example input file is -
qwe wer ert rty tyu
asd sdf dgf dfg fgh
qwe wer det rtyyui
jhkj ert asd asd dfgd
now
qwe should be replace with aaaaaa
asd should be replace with bbbbbbbb
rty should be replace... (6 Replies)
Discussion started by: wildhorse
6 Replies
6. Shell Programming and Scripting
Hi All,
I need to write a script that will go through 600+ files and perform find and replace. I was going to use sed but there is a level of complexity that is doing my head in.
To explain: I have 600+ files that have a line in them that reads (for example)
FILE=DCLCLHST... (4 Replies)
Discussion started by: Kocko
4 Replies
7. Shell Programming and Scripting
Hi all
im having trouble starting with a shell script, i hope someone here can help me
i have 2 files
file1:
404905.jpg 516167
404906.jpg 516168
404917.psd 516183
404947.pdf 516250
file2:
516250 /tmp/RecyclePoster18241.pdf
516167 /tmp/ReunionCardFINAL.jpg
516168... (7 Replies)
Discussion started by: kenray
7 Replies
8. Shell Programming and Scripting
I used the following script
cd pathname
for y in `ls *`;
do sed "s/ABCD/DCBA/g" $y > temp; mv temp $y;
done
and it worked fine for finding and replacing strings with names etc. in all files of the given path.
I'm trying to replace a string which consists of path (location of file)
... (11 Replies)
Discussion started by: pharos467
11 Replies
9. Shell Programming and Scripting
hi guys,
Suppose you have 100 files in a folder and you want to replace all occurances of a word say "ABCD" in those files with "DCBA", how would you do
it ???
jatin (13 Replies)
Discussion started by: jatins_s
13 Replies
10. UNIX for Dummies Questions & Answers
Hi all,
I have a script that scan files, find old templet and replace it with new one.
#!/bin/ksh
file_name=$1
old_templet=$2
new_templet=$3
# Loop through every file like this
for file in file_name
do
cat $file | sed "s/old_templet/new_templet/g" > $file.new
#do a global searce and... (8 Replies)
Discussion started by: amir_yosha
8 Replies