Search a multi-line shell command output and execute logic based on result
The following is a multi-line shell command example:
What I would like to accomplish here is to use the above multi-lines returned by cargo build command. Search all multi-lines for error[] substrings and store the count in a variable so the result can be used to handle another case logic.
Ideally, I want to accomplish something along the following code block:
I realize the above block is broken. This is just what I have to work with for the moment. The only difference in my example is that I need to search for error and brackets strings and not the error string by itself. i.e. error[E0412] the top cargo build command should return a count of 2
Hi every one
I'm writing C program that do the following:
will creat new sample command in unix using C
let be the name is do.c, the do must execute more the one command
for example do ls ps
it will execute ls the ps
also I should create a log file the track the command and exit status of... (4 Replies)
Hi I am trying to run 2 servers using a script one after the other.
I start the first one:
run.sh -c servername >> jboss_log.txt &
Then I have to wait until I see Started message in the log file before I launch the other server.
I can't use sleep because I am not sure how long it'll... (5 Replies)
Hi,
My Oracle query is returing below o/p
----------------------------------------------------------
Ins trnas value
a lkp1 x
a lkp1 y
b lkp1 a
b lkp2 x
b lkp2 y ... (7 Replies)
I have a file with data records separated by multiple equals signs, as below.
==========
RECORD 1
==========
RECORD 2
DATA LINE
==========
RECORD 3
==========
RECORD 4
DATA LINE
==========
RECORD 5
DATA LINE
==========
I need to filter out all data from this file where the... (2 Replies)
Hi
I have a different requirement,
I need to run some application on my device from a file app_name.txt one by one which is like this:
/usr/apps/email
/usr/apps/message
/usr/apps/settings
after each app while it is running I need to execute again one cmd like
ps -ef |grep... (2 Replies)
Hi I would appreciate your help with this.
I have a output file from a command. It is broken based on initial of the users. Exmaple of iitials MN & SS. Under each section there is information pertaining to the user however each section can have different number of lines. MY challenge is to ... (5 Replies)
I have a simple task to replace unix line feed end of line characters with carriage returns.
When I run the following “change file in place” sed instruction from the command line all the Line feeds are successfully replaced with Carriage returns.
sed -i 's/$/\r/' lf_file.txt
But that same... (1 Reply)
Hello :)
new to bash not to programming.
I have an on-going need to change the owning group on sets of files and directories from the one they were created with or changed to on update to the one they need to have going forward.
find {target_root} -group wrong_group
gets me a newline... (4 Replies)
Hi everyone,
I have two question
1- I want to execute command in shell and after execution result show in a web server. (kind of making UI )
e.g.
in shell
root ~: show list
item1
item2
item(n)in web server
in a page draw a table and show those items in itno | name... (1 Reply)
Hi,
Can anyone help me for merge the following multi-line log which beginning with a " and line ending with ": into one line.
*****Original Log*****
087;2008-12-06;084403;"mc;;SYHLR6AP1D\LNZW;AD-703;1;12475;SYHLR6AP1B;1.1.1.1;0000000062;HGPDI:MSISDN=12345678,APNID=1,EQOSID=365;... (3 Replies)
Discussion started by: rajeshlinux2010
3 Replies
LEARN ABOUT HPUX
build-rdeps
BUILD-RDEPS(1)BUILD-RDEPS(1)NAME
build-rdeps - find packages that depend on a specific package to build (reverse build depends)
SYNOPSIS
build-rdeps package
DESCRIPTION
build-rdeps searches for all packages that build-depend on the specified package.
OPTIONS -u, --update
Run apt-get update before searching for build-depends.
-s, --sudo
Use sudo when running apt-get update. Has no effect if -u is omitted.
--distribution
Select another distribution, which is searched for build-depends.
--only-main
Ignore contrib and non-free
--exclude-component
Ignore the given component (e.g. main, contrib, non-free).
--origin
Restrict the search to only the specified origin (such as "Debian").
-m, --print-maintainer
Print the value of the maintainer field for each package.
-d, --debug
Run the debug mode
--help
Show the usage information.
--version
Show the version information.
REQUIREMENTS
The tool requires apt Sources files to be around for the checked components. In the default case this means that in /var/lib/apt/lists
files need to be around for main, contrib and non-free.
In practice this means one needs to add one deb-src line for each component, e.g.
deb-src http://<mirror>/debian <dist> main contrib non-free
and run apt-get update afterwards or use the update option of this tool.
LICENSE
This code is copyright by Patrick Schoenfeld <schoenfeld@debian.org>, all rights reserved. This program comes with ABSOLUTELEY NO
WARRANTY. You are free to redistribute this code under the terms of the GNU General Public License, version 2 or later.
AUTHOR
Patrick Schoenfeld <schoenfeld@debian.org>
Debian Utilities 2013-12-23 BUILD-RDEPS(1)