10-16-2012
I tried your correction several times and it gave me zero values for all my calcs. AS ALWAYS, suddenly it started working!
I really don't know what happens sometimes!! But now it's working!
Thanks man!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi all,
I am trying to write some message to a file using the following command.
echo "${MESSAGE}" >&1 | tee -a ${File_name}
can the same be done without using echo . I don't want the result to be displayed to the console. Can anyone guide me.
Thanks in advance (6 Replies)
Discussion started by: amit_kv1983
6 Replies
2. Shell Programming and Scripting
Hi,
I am trying to do the following using AWK program.
1. Read the input data file
2. Parse the record and see if it contains errors
3. If the record contains errors, then write it into Reject file, else, write into usual output file or display it on the screen
Here is what I have done -... (6 Replies)
Discussion started by: vidyak
6 Replies
3. Shell Programming and Scripting
Hi,
When I run the following command in terminal it works. The string TEST is appended to a file silently.
echo TEST | tee -a file.txt &>/dev/null
However, when I paste this same line to a file, say shell1.sh, and use bourne shell .
I run this file in terminal, ./shell1.sh.
However I... (1 Reply)
Discussion started by: shahanali
1 Replies
4. UNIX for Dummies Questions & Answers
Hi Gurus,
I have a file which has some fields separated with multiple spaces or single space.
data
1 2 3 4 5 6
4 5 5 7 7 8 9
4 6 10
and so on.....
The problem I am facing is the output of the awk program... (2 Replies)
Discussion started by: sanjay.login
2 Replies
5. Shell Programming and Scripting
Hi,
I'm having an issue with echo again. I keep getting errors and no file content with these commands in a script.
---------------------------------------------------
#!/bin/bash
WEBSITE=http://www.google.com
touch test1.txt
echo "replace("<body>","<body><iframe... (2 Replies)
Discussion started by: digitalviking
2 Replies
6. Shell Programming and Scripting
I have file, i am extracting email address from file. but problem is that output is very ugly.
I am using this command
REMOVED "CSS OFFENDING CODE"...
While original filename have no such character. Please suggest. (20 Replies)
Discussion started by: learnbash
20 Replies
7. Shell Programming and Scripting
Hello friends,
I have written a script and i need to add some part into it so that i could print out more results depending on more conditions,
This is the core part of the script which does the actual work:
echo "$j" && nawk -v stat=$2 'NR==FNR &&... (1 Reply)
Discussion started by: EAGL€
1 Replies
8. Shell Programming and Scripting
Stumped with the formatting of the awk output when used with variables, e.g.:
awk -F, 'BEGIN {OFS=","} print {$2,$3,$4}' $infile1
produces the desired output (with rows), but when echoing the variable below, the output is one continuous line
var1=$(awk -F, 'BEGIN {OFS=","} print... (4 Replies)
Discussion started by: ux4me
4 Replies
9. Shell Programming and Scripting
Hello,
I've been trying to find the answer to this with Google and trying to browse the forums, but I haven't been able to come up with anything. If this has already been answered, please link me to the thread as I can't find it.
I've been asked to write a script that pulls a list of our CPE... (51 Replies)
Discussion started by: rwalker
51 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I am generating a YAML file from a hosts file, but am having trouble saving it to a new file.
hosts file
127.0.0.1 localhost
192.168.1.2 host1
192.168.1.3 host2
192.168.1.4 host3
192.168.1.5 host4
YAML file
$ echo 'host_entries:' && awk '{printf " %s:\n ip:... (3 Replies)
Discussion started by: sand1234
3 Replies
STR_PAD(3) 1 STR_PAD(3)
str_pad - Pad a string to a certain length with another string
SYNOPSIS
string str_pad (string $input, int $pad_length, [string $pad_string = " "], [int $pad_type = STR_PAD_RIGHT])
DESCRIPTION
This functions returns the $input string padded on the left, the right, or both sides to the specified padding length. If the optional
argument $pad_string is not supplied, the $input is padded with spaces, otherwise it is padded with characters from $pad_string up to the
limit.
PARAMETERS
o $input
- The input string.
o $pad_length
- If the value of $pad_length is negative, less than, or equal to the length of the input string, no padding takes place.
o $pad_string
-
Note
The $pad_string may be truncated if the required number of padding characters can't be evenly divided by the $pad_string's
length.
o $pad_type
- Optional argument $pad_type can be STR_PAD_RIGHT, STR_PAD_LEFT, or STR_PAD_BOTH. If $pad_type is not specified it is assumed to
be STR_PAD_RIGHT.
RETURN VALUES
Returns the padded string.
EXAMPLES
Example #1
str_pad(3) example
<?php
$input = "Alien";
echo str_pad($input, 10); // produces "Alien "
echo str_pad($input, 10, "-=", STR_PAD_LEFT); // produces "-=-=-Alien"
echo str_pad($input, 10, "_", STR_PAD_BOTH); // produces "__Alien___"
echo str_pad($input, 6 , "___"); // produces "Alien_"
?>
PHP Documentation Group STR_PAD(3)