Search Results

Search: Posts Made By: royalibrahim
1,752
Posted By royalibrahim
Andrew, thank you for the suggestion. I had...
Andrew, thank you for the suggestion. I had already explored lvs -o and I did not see any provision to get device mapper path and dm device path as I expected using that
1,752
Posted By royalibrahim
Command to see the logical volume path, device mapper path and its corresponding dm device path
Currently I am using this laborious command

lvdisplay | awk '/LV Path/ {p=$3} /LV Name/ {n=$3} /VG Name/ {v=$3} /Block device/ {d=$3; sub(".*:", "/dev/dm-", d); printf "%s\t%s\t%s\n", p,...
1,118
Posted By royalibrahim
Perl one-line substitution syntax
Hi,

With the following Perl syntax, how to print the $_ value after the substitution?
s/(\s*|\n)//g foreach (<>);
If I use the below code, it produces some numeric output print s/(\s*|\n)//g...
17,204
Posted By royalibrahim
Awesome radoulov...
Awesome radoulov (https://www.unix.com/members/302021308.html) :) for pointing out the glitch.

By the way, the following query is repeated in the scriptsql 'alter system archive log current';
Is...
17,204
Posted By royalibrahim
RMAN script gives error
Hi,

I have the following RMAN incremental shell script:

# !/bin/bash

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=ORCL
export PATH=$PATH:${ORACLE_HOME}/bin...
4,800
Posted By royalibrahim
Counting all words that start with a capital letter in a string using python dictionary
Hi,

I have written the following python snippet to store the capital letter starting words into a dictionary as key and no of its appearances as a value in this dictionary against the key....
1,051
Posted By royalibrahim
Brilliant MadeInGermany...
Brilliant MadeInGermany (https://www.unix.com/member.php?u=302116191)!! Also, could you please help me to how to use awk variable in this scenario?
1,051
Posted By royalibrahim
How to correct this awk code without eval?
Hi everyone,

The following piece of awk code works fine if I use eval builtin
var='$1,$2'
ps | eval "awk '{print $var}'"

But when I try to knock off eval and use awk variable as substitute...
652
Posted By royalibrahim
Commenting out "expr" creates weird behavior
This really puzzles me. The following code gives me the error 'expr: syntax error' when I try to do multi-line comment using here document
<<EOF
echo "Sum is: `expr $1 + $2`"
EOF

Even if I...
12,873
Posted By royalibrahim
Awesome!! :), so can I do anything for this piece...
Awesome!! :), so can I do anything for this piece of code (cat ~/.cshrc; echo exec bash) | csh in order to make it work?
12,873
Posted By royalibrahim
True, but would like to explore new stuffs :) ...
True, but would like to explore new stuffs :)

Could anyone correct my code?
12,873
Posted By royalibrahim
Sourcing .cshrc (C shell) environment variables to bash
I have tried with the following:
csh -c 'source ~/.cshrc; exec bash' # works perfectly
(cat ~/.cshrc; echo exec bash) | csh # not working


And, using sed, I successfully retrieved the...
Forum: Programming 10-01-2013
4,274
Posted By royalibrahim
Thanks Corona688...
Thanks Corona688 (https://www.unix.com/members/43551.html), your solution worked :), just wanted to know why in string class we need an 'explicit' constructor? any thoughts on this....
Forum: Programming 09-26-2013
4,274
Posted By royalibrahim
C++ string class design and implementation
Hi,

I am designing the look-alike C++ string class:

#include <iostream>
#include <cstring>
#include <exception>
#include <new>
#define ALLOC(N) (char*) new char[sizeof(char)*(N)]
#define...
4,651
Posted By royalibrahim
Somehow this code gives the expected output :)...
Somehow this code gives the expected output :) But still figuring out how I got the output even, when I am not specifying the delimiter ';'
perl -lane '$hash{@F[0]} = $_; END { foreach (sort keys...
2,516
Posted By royalibrahim
Perl write and read on same file
Hi,

I am trying to do a write operation followed by a read operation on the same file through Perl, expecting the output produced by read to contain the new lines added, as follows:

#!...
3,098
Posted By royalibrahim
Perl regexp to extract first and second column
Hi,

I am trying with the below Perl one-liner using regular expression to extract the first and second column of a text file:

perl -p -e "s/\s*(\w+).*/$1/"
perl -p -e "s/\s*.+\s(.+)\s*/$1\n/"...
1,212
Posted By royalibrahim
sed syntax error
Hi,

In the following excerpt of shell script code: I could not understand the sed syntax. Could anyone shed some light on this?

configure_ssl()
{
jboss_conf_file=$1
echo "Configuring...
1,121
Posted By royalibrahim
Echo's strange output
Hi,

Kindly help me to understand the behavior or logic of the below shell command
$ echo $!#
echo $echo $
$

$ echo !$#
echo $#
0

I am using GNU bash, version 3.2.25(1)-release
Forum: Programming 06-12-2013
1,320
Posted By royalibrahim
Thanks a lot for the impeccable and intuitive...
Thanks a lot for the impeccable and intuitive hint!! hats off to you "The Geek" :)

But a small correction is, I have to do it for the name variable inside main() instead of passwd variable in the...
Forum: Programming 06-11-2013
1,320
Posted By royalibrahim
Tweaked getpass() function gives an untraceable bug
I have customized the getpass() as follows:

char* my_getpass(const char* str) {
struct termios oflags, nflags;
static char passwd[64];

/* disabling echo */
...
Forum: Programming 06-03-2013
1,722
Posted By royalibrahim
Difference in multiple inheritance and multilevel inheritance: same method name ambiguity problem
Hi,

In multi-level inheritance:

class A {
public:
void fun() { cout << "A" << endl; }
};

class B : public A {
public:
void fun() { cout << "A" << endl; }
};

class C : public...
Forum: Programming 04-05-2013
4,413
Posted By royalibrahim
Understanding C++ template partial specialization with pointer datatype arguments
When I compile the below code, I am getting error as

template<typename T> T AddFun(T i, T j) {
return i + j;
}

template<> T* AddFun<T*>(T* i, T* j) {
return new T(*i + *j);
}
...
Forum: Programming 03-27-2013
15,469
Posted By royalibrahim
Thanks alister...
Thanks alister (https://www.unix.com/members/302072559.html), but when you say so then why in file2.c, the identifier 'i' is not referring to the same externally-linked, global storage allocation as...
Forum: Programming 03-26-2013
15,469
Posted By royalibrahim
C program multiple definition error during linking time
Hi,

I have the following files:

// file.hvoid foo();
int i = 5; // should be just declared as extern int i;

// file1.c#include <stdio.h>
#include "file.h"

void foo() {
i = 10;
...
Showing results 1 to 25 of 347

 

Featured Tech Videos

All times are GMT -4. The time now is 09:51 PM.
Unix & Linux Forums Content Copyright 1993-2019. All Rights Reserved.
Privacy Policy