10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello Mates
I am trying to write a script, which appends and prepends the text in a file.
I tried testing with a small file and it worked fine.
but for the large file, the script is wiping the entire file and adds only the word to be appended in the file.
mv $file_name $file_name.bak
sed... (6 Replies)
Discussion started by: sathyaac
6 Replies
2. Shell Programming and Scripting
I do a lot of TSM work and I embarked on what I thought would be an easy task, and I'd be very happy for any input to save the pounding my keyboard is receiving :]
By default, the output of TSM's console has no timestamping, making it hard to sort through accurately.
This puts my console into... (5 Replies)
Discussion started by: Vryali
5 Replies
3. Shell Programming and Scripting
Hi,
How to replace only the function calls with a new name and skip the function definition and declarations. consider the following code.
There are 2 functions defined here returnint and returnvoid.
I need to replace returnint with giveint and returnvoid with givevoid only in the function... (2 Replies)
Discussion started by: i.srini89
2 Replies
4. Shell Programming and Scripting
I have got about 100 ascii files and I want replace some variable with a new one on an HP-UX system. But I want to put a line of comments before the change. I want to make file1 to file2. I am explaining below.
file1:
line1
line2
export QNAME=ABC
line4
line5
file2:
line1
line2
#... (3 Replies)
Discussion started by: asutoshch
3 Replies
5. UNIX for Dummies Questions & Answers
I have a number of dat-files, such as abc.dat, def.dat etc, as follows:
2011-07-01 100.0
2011-07-02 101.0
2011-07-03 101.7
I want to prepend the file with the base file name; so for abc.dat it would result in the following:
abc 2011-07-01 100.0
abc 2011-07-02 101.0
abc 2011-07-03 ... (5 Replies)
Discussion started by: figaro
5 Replies
6. UNIX for Dummies Questions & Answers
I would like to know how to take information from a filename and place it into the text of the same file. Let's say I have a file called height_2_width_1.txt containing data that is related to a height of 2 and a width of 1, and the text originally looks like this:
where these two columns... (13 Replies)
Discussion started by: Scatterbrain26
13 Replies
7. Shell Programming and Scripting
Hi! I'm trying to take multiple text files (6), which have text on some lines but not others, and combine them. I'd also like to make the values in one column of some of the files (files 4-6) negative. I'm trying to write a short script (see below) as I have to do this with a large number of... (2 Replies)
Discussion started by: felix.echidna
2 Replies
8. Shell Programming and Scripting
Hi all,
I have little experience with Scripting so hoping someone may be able to help me or point me in the right direction.
I have a shell script which was outputting uncaught exceptions to a log file.
$JAVA_MAIN_CLASS > $LOGNAME 2>&1
What I want to be able to do is prepend a timestamp on... (8 Replies)
Discussion started by: MacAonghusa
8 Replies
9. Shell Programming and Scripting
Hi All,
I have a file as below:
cat myfile
abcdef
NA
rwer
tyujkl
na
I wish to add the text ".txt" at the end of all lines except the lines starting with NA or na.
I know i can add text at the end of line using following command but I am not sure how to valiate the condition. (14 Replies)
Discussion started by: angshuman
14 Replies
10. Shell Programming and Scripting
Hello Dudes,
I have a task to make a unix shell script that should search for a
specific TEXT in a file.If that TEXT is found, shell script should add
a comment statement before that TEXT line.
Ex : LINE 1 xxxxx
LINE 2 xxxx CALL xxxx
LINE 3 xxxx PERFORM UNTIL
if i... (1 Reply)
Discussion started by: kirrushna
1 Replies