Hi guys
I tried to convert this c++ code to c shell script but there are some bugs and I don't know how to solve it.
This code prints the three variables in decreasing order:
if ( ( grep -i "Exception : " /home/dklog* ))
then
echo " improper combination"
elsif ( ( grep -i "invalid" /home/dklog*))
then
echo " wrong process "
fi
fi
in the above case i am facing the the syntx error
please help in this case... (3 Replies)
I have a shell script which I made with the help of this forum
#!/bin/sh
RuleNum=$1
cat bw_rules | sed 's/^.*-x //' | awk -v var=$RuleNum '$1==var {for(i=1;i<=NF;i++) {if($i=="-bwout") print $(i+3),$(i+1)}}'
Basically I have a pages after pages of bandwidth rules and the script gives... (0 Replies)
Dear!
I've a script (vbscript) running on windows machine for along time ago. 2 weeks ago, we changed server from Windows to RHEL5, and this script did not run, and I'm not programmer. So that, I post this script here and wish you convert for me.
vbscript code:
'This script will:
' - ZIP... (1 Reply)
Hi is there a way that i can convert this simple perl program into shell script
#!usr/bin/perl -w
use strict;
use warnings;
open INPUTFILE, "uniqprobecoordinates.out" || die "canot open the file $!";
open OUTPUTFILE, ">", "1_4reads.out";
while(<INPUTFILE>)
{
chomp;
... (3 Replies)
how to convert these code to shell script
#include<stdio.h>
#include<conio.h>
main()
{
int
i,j,a=0,b=0,c=0,f,t,al,ta;
int a1, max, n, n1,p,k=0;
printf(“\n enter no.of resources”);
scanf(“%d”,n1);
printf(“\nenter the max no .of resources for each type”);
for(i=0;i<n1;i++)... (4 Replies)
I had try to create a basic shell script. So now im trying to convert in to C-programming language can some one guide/help me out with it?(BTW IM USING A LINUX/UNIX/ORACLE SYSTEM) CODE BELOW
!/bin/bash
for i in `ls -1 /cslab/home/JAZEL/`
do
cp -uv $i /cslab/home/JAZEL/cs295/$i.`date... (2 Replies)
Hello,
Met a problem when compiling a C++ program from source code without error, but when ran it there was always an error message:
./Ray: error while loading shared libraries: libmpi_cxx.so.1: cannot open shared object file: No such file or directoryAs the error points to openmpi which was... (0 Replies)
Discussion started by: yifangt
0 Replies
LEARN ABOUT DEBIAN
hostname
FBB::Hostname(3bobcat) Host Info FBB::Hostname(3bobcat)NAME
FBB::Hostname - Contains name/address info about a host
SYNOPSIS
#include <bobcat/hostname>
Linking option: -lbobcat
DESCRIPTION
FBB::Hostname objects inherit from Hostent, and offers information about a host, like Hostent. Apart from being initialized by a hostname
or host address, they can also be initialized by a FBB::InetAddress object. Most of the functionality of an FBB::Hostname object is avail-
able through its parent-class FBB::Hostent.
NAMESPACE
FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.
INHERITS FROM
FBB::Hostent
CONSTRUCTORS
o Hostname():
The default constructor initializes an empty FBB::Hostname object.
o Hostname((std::string const &host)):
This constructor initializes an FBB::Hostname object from a string representing the name or dotted decimal address of a host. An
FBB::Errno object is thrown if the hostname information could not be retrieved.
o Hostname(InetAddress const &inetAddress):
This constructor initializes an FBB::Hostname object from an InetAddress object. An FBB::Errno object is thrown if the hostname
information could not be retrieved. The copy constructor is available.
MEMBER FUNCTIONS
All members of FBB::Hostent are available, as FBB::Hostname inherits from this class. There are no additional members.
EXAMPLE
#include <iostream>
#include <bobcat/hostname>
#include <bobcat/errno>
using namespace std;
using namespace FBB;
int main(int argc, char **argv)
{
while (true)
{
cout << "Enter name or address:
";
string str;
if (!getline(cin, str))
return 0;
if (str == "")
break;
try
{
Hostname h(str);
cout << "Official name:
";
cout << h.hostname() << endl;
cout << "Aliases:
";
for (size_t idx = 0; idx < h.nAliases(); idx++)
cout << h.alias(idx) << " ";
cout << endl;
cout << "Adresses:
";
for (size_t idx = 0; idx < h.nAddresses(); idx++)
cout << h.dottedDecimalAddress(idx) << " ";
cout << endl;
}
catch (Errno const &err)
{
cout << err.why() << endl;
}
}
return 0;
}
FILES
bobcat/hostname - defines the class interface
SEE ALSO bobcat(7), hostent(3bobcat)BUGS
None Reported.
DISTRIBUTION FILES
o bobcat_3.01.00-x.dsc: detached signature;
o bobcat_3.01.00-x.tar.gz: source archive;
o bobcat_3.01.00-x_i386.changes: change log;
o libbobcat1_3.01.00-x_*.deb: debian package holding the libraries;
o libbobcat1-dev_3.01.00-x_*.deb: debian package holding the libraries, headers and manual pages;
o http://sourceforge.net/projects/bobcat: public archive location;
BOBCAT
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'.
COPYRIGHT
This is free software, distributed under the terms of the GNU General Public License (GPL).
AUTHOR
Frank B. Brokken (f.b.brokken@rug.nl).
libbobcat1-dev_3.01.00-x.tar.gz 2005-2012 FBB::Hostname(3bobcat)