Sponsored Content
Full Discussion: Remove error code in output
Top Forums Shell Programming and Scripting Remove error code in output Post 302841213 by konsolebox on Wednesday 7th of August 2013 05:55:39 AM
Old 08-07-2013
It's also a good idea to quote your variables properly:
Code:
w=`sed -e 's/\(.*!\)\(.*\)\(, Queue.*$\)/\2/' out.dat | awk '/'$1'/{n=0;{print $n}}' | head -n 1`
if [ "$1" = "$w" ]; then
    x=`sed -e 's/\(.*!\)\(.*\)\(, Queue.*$\)/\2/' out.dat | awk '/'$1'/{n=2;next}n{print $2;n--}' | head -n 1`
    y=`sed -e 's/\(.*!\)\(.*\)\(, Queue.*$\)/\2/' out.dat | awk '/'$1'/{n=2;next}n{print $2;n--}' | tail -n 1`
    z=`expr "$x" + "$y"`
    echo "$z"
else
    echo "-1"
fi

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

help:how to remove headers in output file

Hi I am running a script (which compares two directory contents) for which I am getting an output of 70 pages in which few pages are blank so I was able to delete those blank lines. But I also want to delete the headers present for each page. can any one help me by providing the code... (1 Reply)
Discussion started by: raj_thota
1 Replies

2. Shell Programming and Scripting

How do i remove the unneccesary output ?

Hi , I have written a csh script which is as follows but it keeps outputing a unneccesary output as show below. How can i remove that output and prevent it from displaying it when the script runs? set USER = "aaa" set PASSWORD = "bbb" ftp -n 10.80.12.18<<XX user $USER $PASSWORD... (2 Replies)
Discussion started by: Raynon
2 Replies

3. Shell Programming and Scripting

Remove Garbage Output

Hello Friends, In a script i m using different temporary file and i remove them in the end. During script execution i have some garbage output which is not required. For example: Garbage Output ++ rm temp_out temp_a temp_b temp_c ++ rm Filter1 Filter2 Script : Even i am redirecting rm... (7 Replies)
Discussion started by: Danish Shakil
7 Replies

4. UNIX for Dummies Questions & Answers

How to remove/prevent Input/output error

Hi I have a new hdd installed ,and sometimes if i start a session or ftp download while downloading sometimes it creates a ./filename.type Input/output errorso in that case i can-not overwrite ,rename ,remove ,or place a file with the same name on that dir. How to prevent this and is there... (3 Replies)
Discussion started by: brain!ac
3 Replies

5. Shell Programming and Scripting

Remove Double Value at Latest Output

Hello all, I have file like this: input.dat: 3778 10000 25 3778 10001 26 3778 10002 29 3779 10000 30 3779 10010 31 ... (2 Replies)
Discussion started by: attila
2 Replies

6. UNIX for Dummies Questions & Answers

Remove area code using from awk output

I am back again with one more question, so I have a phonebook file with names, phone#s for example: smith, joe 123-456-7890 using awk I want to display all entries with a specific area code. here 's what i have tried so far: awk '$2~/^123/ {print}' phonebook I can't figure... (1 Reply)
Discussion started by: Nirav4
1 Replies

7. Shell Programming and Scripting

[SOLVED] Want to remove output from a command

Hi, I'm on AIX 5.2. I wrote a script that makes a traceroute to a host. The script works fine but each time it using the traceroute command its generate the 2 output lines. this is the command in my script traceroute -n -m 5 -w 2 $Host | grep 172 | awk '{print $2}' | tail -1 traceroute... (2 Replies)
Discussion started by: ce9888
2 Replies

8. Shell Programming and Scripting

Extra Space in output - remove

Hi All I am trying to perform the below operation -count=`cat abc.txt | wc -l` echo$count 5 Head=Start"$DATE"00000"$count"File echo $HEAD START15020300000 5File There is a space coming before 5 which is not needed . How to ignore that . (4 Replies)
Discussion started by: honey26
4 Replies

9. UNIX for Beginners Questions & Answers

When I run the code yesterday I am getting output,when I run same code today I am getting error?

If run the below code today its creating all directory and getting output files,I f run same code tomorrow I am getting error. can any one give suggestion to sortout this error. OSError: no such file or directory : '062518'My code looks like this import paramiko import sys import os ... (8 Replies)
Discussion started by: haribabu2229
8 Replies

10. Shell Programming and Scripting

How to remove filename from output file?

Hello, I am trying to print searched multiple keywords in multiple files. It is almost okay with the code but the code puts filename in front of each line. How may I get rid of it? -grep -A1 'word1' *.txt | grep -A1 'word2' | grep -A1 'word3' I expect: Real outcome: How may I... (3 Replies)
Discussion started by: baris35
3 Replies
GSL-HISTOGRAM(1)					      General Commands Manual						  GSL-HISTOGRAM(1)

NAME
gsl-histogram - compute histogram of data on stdin SYNOPSYS
gsl-histogram xmin xmax [n] DESCRIPTION
gsl-histogram is a demonstration program for the GNU Scientific Library. It takes three arguments, specifying the upper and lower bounds of the histogram and the number of bins. It then reads numbers from `stdin', one line at a time, and adds them to the histogram. When there is no more data to read it prints out the accumulated histogram using gsl_histogram_fprintf. If n is unspecified then bins of inte- ger width are used. EXAMPLE
Here is an example. We generate 10000 random samples from a Cauchy distribution with a width of 30 and histogram them over the range -100 to 100, using 200 bins. gsl-randist 0 10000 cauchy 30 | gsl-histogram -100 100 200 > histogram.dat A plot of the resulting histogram will show the familiar shape of the Cauchy distribution with fluctuations caused by the finite sample size. awk '{print $1, $3 ; print $2, $3}' histogram.dat | graph -T X SEE ALSO
gsl(3), gsl-randist(1). AUTHOR
gsl-histogram was written by Brian Gough. Copyright 1996-2000; for copying conditions see the GNU General Public Licence. This manual page was added by the Dirk Eddelbuettel <edd@debian.org>, the Debian GNU/Linux maintainer for GSL. GNU
GSL-HISTOGRAM(1)
All times are GMT -4. The time now is 08:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy