10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I've been struggling with this one for quite a while and cannot seem to find a solution for this find/replace scenario. Perhaps I'm getting rusty.
I have a file that contains a number of metrics (exactly 3 fields per line) from a few appliances that are collected in parallel. To identify the... (3 Replies)
Discussion started by: verdepollo
3 Replies
2. Shell Programming and Scripting
Looking to add text to a file, example
File example;
nodegroups:
check-hosts: L@host.domain.com,host2.domain.com,host3.domain.com
I need to take a file with a one line list of hosts separated by commas
host.domain.com,host2.domain.com,host3.domain.comand prepend the string " ... (6 Replies)
Discussion started by: bash_in_my_head
6 Replies
3. Shell Programming and Scripting
Prepending lines with: your, the, a or an based on 1st letter match. You'll see my problem below:
sed '/^p\|^f\|^c\|^d\|^l/ s/^/your /' list.txt > your.txt && sed '/^v\|^j\|^k\|^m\|^n\|^s/ s/^/the /' your.txt > the.txt && sed '/^b\|^g\|^h\|^q\|^r\|^t\|^w\|^z/ s/^/a /' the.txt > a.txt && sed... (10 Replies)
Discussion started by: p1ne
10 Replies
4. Shell Programming and Scripting
i have to append a text file
grep for a word, if found, put comment in starting of the line.
here is an example
cat test.sh
bin/ksh
Hello World
Test Message
:wq!
search for "bin" word in test.sh file if found comment it out at starting of the line:
Output as follows:
#bin/ksh... (5 Replies)
Discussion started by: raghur77
5 Replies
5. Shell Programming and Scripting
Hi,
I have a file with email header information. I would like to change the Subject line.
Subject: ** PROBLEM Host Alert: server.domainname is DOWN **
I'd like to change this line such as to look,
Subject: serverID ACK Fw: ** PROBLEM Host Alert: server1.domainname is DOWN**
How can I... (2 Replies)
Discussion started by: upengan78
2 Replies
6. Shell Programming and Scripting
Hello everyone, I've suddenly gotten very interested in sed and awk (and enjoying it quite a bit too) because of a large conversion project that we're working on. I'm currently stuck with a very inefficient process for processing text blocks. I'm sure someone here should be able to easily point out... (2 Replies)
Discussion started by: jameswatson3
2 Replies
7. Shell Programming and Scripting
Hello all.
I was wondering if it possible to write a bash script that would do the following:
I perform molecular modelling calculations and the output files are all text files with various different extensions.
For example, I submit the input file "job_name.inp" and when it is done or the... (18 Replies)
Discussion started by: marcozd
18 Replies
8. Shell Programming and Scripting
Hi,
I have a file 'tmp.dat' that contains the below data:
81763
40829
30405
80452
I want to prepend a ' character to the beginning of every line, and I want to append ', at the end of every line. Below is what I expect:
'81763',
'40829',
'30405',
'80452',
Can anyone help me?
... (3 Replies)
Discussion started by: ChicagoBlues
3 Replies
9. UNIX for Dummies Questions & Answers
i have something like below in my SAS code and every month i need to append a text say 'ext.hlc_sum0906' near ext.hlc_sum0905 and next month after ext.hlc_sum0906 i need to append this 'ext.hlc_sum0907' and so on like that.. is it possible using SED or some other command in unix?
%let... (1 Reply)
Discussion started by: depakjan
1 Replies
10. Shell Programming and Scripting
I have a command stream that will parse down an ftp DIR listing of a remote directory and return the name of the newest file that I am interested in. The command is
sed -e '/^d/d' sppay.listing |sed -n -e '/SPPAY/p'|sort -r -k 43M,45 -k 47,48 -k 50,54|sed -n -e '1p'|cut -c 56-99
and what it... (2 Replies)
Discussion started by: beilstwh
2 Replies