10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i am having file like this
#!/bin/bash
read -p 'Username: ' uservar
match='<color="red" />'
text='this is only a test
so please be patient
<color="red" />'
echo "$text" | sed "s/$match/&$uservar\g"
so desireble output what i want is if user type MARIA
this is only a test
so please... (13 Replies)
Discussion started by: tomislav91
13 Replies
2. Shell Programming and Scripting
I need to read a text file and insert a string every n lines, but also have the line counter restart when I come across a header string.
Line repeating working every 3 lines using code:
sed '0~3 s/$/\nINSERT/g' < INPUT/PATH/FILE_NAME.txt > OUTPUT/PATH/FILE_NAME.txt
I cannot seem to find... (1 Reply)
Discussion started by: Skonectthedots
1 Replies
3. Shell Programming and Scripting
I need to insert a comment string to a couple of fields for every line in the file. Different comment string for each field.
In below file, fields 7 and 8
"R","1","t0000684","","10/31/2013","10/31/2013","","","","750.23"... (6 Replies)
Discussion started by: Melah Gindi
6 Replies
4. Shell Programming and Scripting
I have 2 files open in Vim at the same time.
I yank from one with
16yw
and get this
INSERT INTO ALIS_PART_MANU_PART_TAB (SEQUENCE_NO,PART_NO,MANU_NO,MANU_PART_NO,ROWVERSION) VALUES (
Now I go to the second file and type the command to add this to the beginning of every... (3 Replies)
Discussion started by: djehresmann
3 Replies
5. Shell Programming and Scripting
Hi All,
In continuation of my previous thread 'Add text at the end of line conditionally', I need to further modfiy the file after adding text at the end of the line. Now, I need to add a fixed charater string at alternate lines starting from first line using awk or sed.My file is now as below:... (10 Replies)
Discussion started by: angshuman
10 Replies
6. Programming
Basically I'm trying to avoid writing paragraphs to do it. It is possible I could convert over to a vector<int>'s if that may help. Does anyone know how to do this without really turning it into a huge brainbuster? I have considered using a for() loop but I wasn't able to put anything into practice... (1 Reply)
Discussion started by: sepoto
1 Replies
7. Shell Programming and Scripting
Hi,
I am using SunOS
I want to serch my previous command
from unix prompt
(like on AIX we can search by ESC -k)
how to get in SunOs
urgent help require. (10 Replies)
Discussion started by: RahulJoshi
10 Replies
8. Programming
How can i user string or vector ins shared memory ?
For example i have a structure sharedInfo like below
struct sharedInfo {
string szName;
int iAge;
string szAddrees;
};
if i use this notation my program crashes. And if i use char szName, it work fine, what is wrong with... (4 Replies)
Discussion started by: helpmeforlinux
4 Replies
9. UNIX for Dummies Questions & Answers
A developer of mine has this requirement - I couldn't tell her quickly how to do it with UNIX commands or a quick script so she's writing a quick program to do it - but that got my curiousity up and thought I'd ask here for advice.
In a text file, there are some records (about half of them)... (4 Replies)
Discussion started by: LisaS
4 Replies
10. Shell Programming and Scripting
"are you billy_smith ?"
replace with
"are you billy_smith ?
my name is billy_smith"
how to fetch the name "billy_smith" and using it later
I need sed script to do this, any one can help? Thanks (6 Replies)
Discussion started by: playinmel.com
6 Replies