10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I am processing text files looking for a string and replacing the first occurrence of the string with something else.
For the text,id Name
1 methyl-(2-methylpropoxy)-oxoammonium
2 N-amino-N-(methylamino)-2-nitrosoethanamine
3 3-methoxy-3-methyloxazolidin-3-ium... (12 Replies)
Discussion started by: LMHmedchem
12 Replies
2. Shell Programming and Scripting
My script work on Linux but not work in sun os.
my script.
logFiles="sentLog1.log sentLog2.log"
intial_time="0 0"
logLocation="/usr/local/tomcat/logs/"
sleepTime=600
failMessage=":: $(tput bold)Log not update$(tput rmso) = "
successMessage="OK"
arr=($logFiles)... (7 Replies)
Discussion started by: ooilinlove
7 Replies
3. UNIX for Dummies Questions & Answers
$ x="/home/guru/temp/f1.txt"
$ echo $x | sed 's^.*/^^'
This will give the absolute path f1.txt. I don't understand WHY it works. How is it determining the last "/" character exactly? (7 Replies)
Discussion started by: glev2005
7 Replies
4. Shell Programming and Scripting
sed replace not work Pls. help me
I used sed command in my file
66875964560@1982589 90825890001@90825890001@3@15/12/2007 14:25:14@22/03/2010 6:06:13@20/01/2010 3:28:39
66873064490@1925912 90259120001@90259120001@5@02/04/2009 1:51:31@30/10/2009 3:08:34@13/09/2009 8:24:33... (3 Replies)
Discussion started by: ooilinlove
3 Replies
5. UNIX for Dummies Questions & Answers
Hi All,
can anybody tell me what's wrong with this code?
# SEARCH replaced by REPLACE
#!/bin/bash
SEARCH="95$$ 0 t"
REPLACE="95$$ 1 t"
for I in `ls *000.inp | cut -c-12`;
do
echo $I
sed 's/$SEARCH/$REPLACE/' ${I}-000.inp > ${I}-100.inp
done
It don't replace the string... (5 Replies)
Discussion started by: f_o_555
5 Replies
6. Shell Programming and Scripting
Iam trying to insert a line after #Cluster in the property file shown below
#Node=Nodehostname:NodeProfilename
Node=testNode:test_profile
#Cluster=Cluster_Name:nodeName@ClusterMem1,nodeName@ClusterMem2,....
#DC=DCname:DCnodegrp:DCtemp
DC=test_DC:test_NG:test_template
i was using sed command... (12 Replies)
Discussion started by: SSSB
12 Replies
7. Shell Programming and Scripting
Hi all.
I have a script as below:
cutmth=`TZ=CST+2160 date +%b`
export cutmth
echo $cutmth >> date.log
sed -n "/$cutmth/$p" alert_sbdev1.log > alert_summ.log
My purpose is to run through the alert_sbdev1.log and find the 1st occurence of 'Jan' and send everything after that line to... (4 Replies)
Discussion started by: ahSher
4 Replies
8. Shell Programming and Scripting
Hi All,
I'm new to the forum and not a programmer, but I'm writing a bash script to preprocess definitions of technical terms by inserting hyperlinks pointing to other pages in the glossary before the pages are posted to our server, using a standard naming convention for the pages. The... (3 Replies)
Discussion started by: markfgilliland
3 Replies
9. UNIX for Dummies Questions & Answers
Howdie everyone...
I have a shell script RemoveFiles.sh
Inside this file, it only has two commands as below:
rm -f ../../reportToday/temp/*
rm -f ../../report/*
My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Discussion started by: cheongww
2 Replies
10. Shell Programming and Scripting
Hello
I' m confused a bit.
I want to replace string "&" with "&" using this command.
sed 's/&/&/g'
and it doesn't work. Nothing happens.
On the other side this works:
sed 's/&/@/g'
or sed 's/&/^/g' !!!
Can somebody help please?
Thanks (3 Replies)
Discussion started by: billy5
3 Replies