Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to use exit status of two commands in if statement ? Post 303030156 by RudiC on Wednesday 6th of February 2019 05:04:50 PM
Old 02-06-2019
Quote:
Originally Posted by Sekhar419
...

The problem is i want to ignore some erros in different parts of that big file, so i have divided them into small files and then renamed them according to the first line in the file (as you know from my other question) then i will remove the files which i don't want then i will search for the errors in the remaining parts that are created. i don't know yet which parts i should exclude that is why i have the comment as below ...
OK, starts to make some sense now. Knowing that you want to exclude certain parts of the log file, csplit and grep might not be the optimal choice. If you show some more details, a taylored solution based on sed, awk, perl, etc. might be possible.


Quote:
sorry i didn't know how to reply my replies are being smudged one after other quite confusing layout
What do you mean by "smudged"? I usually (not always, I confess) post and then proofread my post to eliminate the obvious nonsense I made.


EDIT: One more comment: As you can see, quite many people posted quite many remarks (to your other, related thread(s) as well) while obviously poking in the dark. Had you clearly described the problem, supplying representative sample input data and e.g. exclusion conditions for error types, you'd highly probably have a taylored overall solution by now. It usually pays back quickly to spend some decent time composing a decent specification!

Last edited by RudiC; 02-06-2019 at 06:11 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

ftp exit status.

Does ftp from unix have an exit status. In the sense after ftp is invoked and if the ftp fails during file transfer does it exit out with a status other than 0. What is do right now is invoke ftp and right it to a log and then grep for 'File Transferred Sucessfully'. Is this the only way to do it... (1 Reply)
Discussion started by: oracle8
1 Replies

2. Shell Programming and Scripting

exit status

i downloaded a text file from metalab.unc.edu called sh.txt and in this reference manual it refers to shell scripting exit status .. at the end of one of the examples that author gave an exit status of 127.. to what does a 127 exit status refer too and what is its purpose in the code. moxxx68 (1 Reply)
Discussion started by: moxxx68
1 Replies

3. Shell Programming and Scripting

How to get the exit status

Hi all, I'm running a program which return 1 upon success. But when encounters problem shell return 's '1' . How to differentiate between them the shell return value and script return value. Ex. function fn return '1' if executed successfully and '0' if failed. But when if shell encounters... (1 Reply)
Discussion started by: yhacks
1 Replies

4. Shell Programming and Scripting

Exit status

I'm preparing for exam and one of exams is to write own test command... I wonder if in unix is a command which just returns exit code you specify.. I know I can easily write a function like this: exStatus() { return $1 } -> my question is rather theoretical thank you! (9 Replies)
Discussion started by: MartyIX
9 Replies

5. Shell Programming and Scripting

Check for exit status

Hi I have following code I want If whole code executes successfully then return true If found any error then print the error I tried if ; then But this checks only for the just upper line execution #!/bin/bash PATH1=/var/log/mysql PATH2=/home/ankur/log FILE1=mysql-bin.index... (4 Replies)
Discussion started by: kaushik02018
4 Replies

6. Shell Programming and Scripting

Exit status redirection

Hi, I'm having this simple code below, the file serverlist has a list of IPs one per line. When executed the while loop is executed only once, after that the program terminates. How should i redirect the exit status, so that the entire list of IP will get executed? #!/bin/bash exec <... (4 Replies)
Discussion started by: agent001
4 Replies

7. UNIX for Dummies Questions & Answers

Using 'diff' exit status in an if statement

is there a way to compare two files using diff (ex: diff 1.txt 2.txt) in an if statement? I read that the exit status of diff is 0 if the files contain the same content. 1 if they're different. So what I am attempting is basically: if ; then echo "they're the same" else ... (2 Replies)
Discussion started by: SoVi3t
2 Replies

8. Shell Programming and Scripting

Exit Status

I have a shell script (#!/bin/sh) that interacts with Appworx and Banner Admin. In my script I want to check the exit status of awrun before continuing. awrun can run for 10 seconds or it can run for over a minute. So my question is, will it go through my if statement before awrun may even be... (2 Replies)
Discussion started by: smkremer
2 Replies

9. Shell Programming and Scripting

exit status from the script is always 0

Hi , I have a bash script , which does the network configuration. Messages from this script are dumped on console as well as stored in a log file . This script is invoked from a C code using system call . The script returns different exit code , to indicate different error cases. The... (1 Reply)
Discussion started by: abhirai
1 Replies

10. Shell Programming and Scripting

Want to get the exit status

Hi All, I am trying to create a zip file with all the txt files(these are in large number) in the current directory. I am able to do this operation sucessfully. After this i want to get the status of the tar command executed and do accordingly. When i am trying with the below code, the status... (3 Replies)
Discussion started by: paddu
3 Replies
bup-memtest(1)						      General Commands Manual						    bup-memtest(1)

NAME
bup-memtest - test bup memory usage statistics SYNOPSIS
bup memtest [options...] DESCRIPTION
bup memtest opens the list of pack indexes in your bup repository, then searches the list for a series of nonexistent objects, printing memory usage statistics after each cycle. Because of the way Unix systems work, the output will usually show a large (and unchanging) value in the VmSize column, because mapping the index files in the first place takes a certain amount of virtual address space. However, this virtual memory usage is entirely virtual; it doesn't take any of your RAM. Over time, bup uses parts of the indexes, which need to be loaded from disk, and this is what causes an increase in the VmRSS column. OPTIONS
-n, --number=number set the number of objects to search for during each cycle (ie. before printing a line of output) -c, --cycles=cycles set the number of cycles (ie. the number of lines of output after the first). The first line of output is always 0 (ie. the base- line before searching for any objects). --ignore-midx ignore any .midx files created by bup midx. This allows you to compare memory performance with and without using midx. --existing search for existing objects instead of searching for random nonexistent ones. This can greatly affect memory usage and performance. Note that most of the time, bup save spends most of its time searching for nonexistent objects, since existing ones are probably in unmodified files that we won't be trying to back up anyway. So the default behaviour reflects real bup performance more accurately. But you might want this option anyway just to make sure you haven't made searching for existing objects much worse than before. EXAMPLE
$ bup memtest -n300 -c5 PackIdxList: using 1 index. VmSize VmRSS VmData VmStk 0 20824 kB 4528 kB 1980 kB 84 kB 300 20828 kB 5828 kB 1984 kB 84 kB 600 20828 kB 6844 kB 1984 kB 84 kB 900 20828 kB 7836 kB 1984 kB 84 kB 1200 20828 kB 8736 kB 1984 kB 84 kB 1500 20828 kB 9452 kB 1984 kB 84 kB $ bup memtest -n300 -c5 --ignore-midx PackIdxList: using 361 indexes. VmSize VmRSS VmData VmStk 0 27444 kB 6552 kB 2516 kB 84 kB 300 27448 kB 15832 kB 2520 kB 84 kB 600 27448 kB 17220 kB 2520 kB 84 kB 900 27448 kB 18012 kB 2520 kB 84 kB 1200 27448 kB 18388 kB 2520 kB 84 kB 1500 27448 kB 18556 kB 2520 kB 84 kB DISCUSSION
When optimizing bup indexing, the first goal is to keep the VmRSS reasonably low. However, it might eventually be necessary to swap in all the indexes, simply because you're searching for a lot of objects, and this will cause your RSS to grow as large as VmSize eventually. The key word here is eventually. As long as VmRSS grows reasonably slowly, the amount of disk activity caused by accessing pack indexes is reasonably small. If it grows quickly, bup will probably spend most of its time swapping index data from disk instead of actually running your backup, so backups will run very slowly. The purpose of bup memtest is to give you an idea of how fast your memory usage is growing, and to help in optimizing bup for better memory use. If you have memory problems you might be asked to send the output of bup memtest to help diagnose the problems. Tip: try using bup midx -a or bup midx -f to see if it helps reduce your memory usage. Trivia: index memory usage in bup (or git) is only really a problem when adding a large number of previously unseen objects. This is because for each object, we need to absolutely confirm that it isn't already in the database, which requires us to search through all the existing pack indexes to ensure that none of them contain the object in question. In the more obvious case of searching for objects that do exist, the objects being searched for are typically related in some way, which means they probably all exist in a small number of pack- files, so memory usage will be constrained to just those packfile indexes. Since git users typically don't add a lot of files in a single run, git doesn't really need a program like bup midx. bup, on the other hand, spends most of its time backing up files it hasn't seen before, so its memory usage patterns are different. SEE ALSO
bup-midx(1) BUP
Part of the bup(1) suite. AUTHORS
Avery Pennarun <apenwarr@gmail.com>. Bup unknown- bup-memtest(1)
All times are GMT -4. The time now is 04:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy