10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have about 350 programs in which I have to add 2 lines; one before and one after a specfic line.
The following script does the job except that I lose the indentation.
#!/usr/bin/bash
while read line ... (8 Replies)
Discussion started by: jgt
8 Replies
2. Shell Programming and Scripting
Hi All,
I am new new to unix.com, I have a question related to shell scripting.
We have a Oracle database backup shell script, which can be used for taking full, incremental & archive log backup based on the parameters passed.
Within the script we export a variable as
export... (5 Replies)
Discussion started by: veeresh_15
5 Replies
3. Shell Programming and Scripting
I'm trying to do something pretty simple but its appears more complicated than expected... I've lines in a text file, separated by the comma and that I want to output to another file, without the first field.
Input file:
file1,item, 12345678
file2,item, 12345678
file2,item, ... (8 Replies)
Discussion started by: Armoric
8 Replies
4. UNIX for Advanced & Expert Users
I created a awk state to calculate the number of success however when the query runs it has a leading zero. Any ideas on how to remove the leading zero from the calculation?
Here is my query:
cat myfile.log | grep | awk '{print $2,$3,$7,$11,$15,$19,$23,$27,$31,$35($19/$15*100)}'
02:00:00... (1 Reply)
Discussion started by: bizomb
1 Replies
5. Shell Programming and Scripting
Given a file:
# configuration file for newsyslog
# $FreeBSD: /repoman/r/ncvs/src/etc/newsyslog.conf,v 1.50 2005/03/02 00:40:55 brooks Exp $
#
# Entries which do not specify the '/pid_file' field will cause the
# syslogd process to be signalled when that log file is rotated. This
# action... (10 Replies)
Discussion started by: jnojr
10 Replies
6. Shell Programming and Scripting
Hello,
I wondering how I can echo a string without having the trailing whitespace removed.
For example I have a string str="TESTING123 " that I need to hash using sha1. I get the correct answer when I run the line below from the terminal
$ echo -n "TESTING123 " | openssl sha1... (3 Replies)
Discussion started by: colinireland
3 Replies
7. Shell Programming and Scripting
Hi,
Consider the data (FS = |):
1| England |end
2| New Zealand |end
3|Australia|end
4| Some Made Up Country |end
5| West Indies|end
I want the output to be (i.e. without the leading and trailing white space from $2)
England
New Zealand
Australia
Some Made Up Country
West... (4 Replies)
Discussion started by: Storms
4 Replies
8. UNIX for Dummies Questions & Answers
Hi experts,
why does
$ echo "one two three" | awk '{$3="my tree"; print $0}'
one two my tree
work,
but
$ var="my tree"
$ echo "one two three" | awk '{$3="'$var'"; print $0}'
awk: {$3="my
awk: ^ unterminated string
does not work?
How can the variable tha contains a space be... (2 Replies)
Discussion started by: GermanicGalore
2 Replies
9. Shell Programming and Scripting
Hi,
I have a large flat file from host without delimiter. I'm transforming this file to a csv file using statements like
# Row 03: Customer / field position 3059 +20
WOFABNAM=substr( $0, 3059, 20 );
and deleting the trailing whitespaces before and after with that
sub( /^ +/, "",... (4 Replies)
Discussion started by: Celald
4 Replies
10. Shell Programming and Scripting
I have these
str1=$(echo "This is string one with spaces \n This is also my sentence 1")
When I echo $str1, it displays the new line character properly.
Now I have another new variable say str2.
I want to concatenate in this way.. str1 + newline character + and then str2.
That's I... (3 Replies)
Discussion started by: dahlia84
3 Replies