Hi,
I got below error
grep: received": No such file or directory
Thanks,
Manjunath
User Profile
Collapse
-
How to get the output of a command?
Hi All,
I need help in below command
/bin/ping -c 2 -W 5 $remotehost | grep \"[12] received\"
I just want to get the output out of the above command. Please can anybody help in this?
1 received
2 received
Thanks & regards, -
Need help in ftp in Shell script
Hi All,
I am facing problem in ftp. I am porting code from Solaris to MV Linux, ftp behaves differently in both.
script is in shell
Code:if [[ "${OSname}" = "Linux" ]] ; then print "= ftp -n -i ${FtpMachine}" >> ${Log} ftp -n -i ${FtpMachine} <<-EOF >> ${Log} 2>&1 user ${Login} ${Password} ...............
-
Hi thanks Jeff.
It made me clear, In my case both MYVERSION[$I]and "$VERSION" are NULL. It means It should not go inside the for loop.
But In Solaris KSH it was getting inside the for loop, and in Linux KSH it was not. Its because of KSH version mismatch.
Thanks,
ManjunathLeave a comment:
-
Need to understand what this for loop will do?
HI All,
Can any one please let me know what this for loop is trying to do
for V in ${MYVERSION[$I]:-"$VERSION"}
what :- stands for? I dont understand this condition,
Can any one help me please?
Thanks
Manjuks -
Hi ashitpro
Thanks for your reply..
Shall I replace this
Code:$cmd = "/usr/sbin/route -n add -host $hoc -gateway $gatewayIp -setsrc $vcip";
Code:$cmd = "/sbin/route -n add -host $hoc -gw $gatewayIp" ; $dev = `netstat -ie | grep -B1 135.254.239.52 | head -n 1 | awk '{print $1}'`; $cmd = "/sbin/route add default gw
Leave a comment:
-
Need help for route command
Hi All,
I need help to port below command to LINUX, it was written for Solaris platform
Code:$cmd = "/usr/sbin/route [B]-n[/B] add [B]-host[/B] $hoc [B]-gateway[/B] $gatewayIp [B]-setsrc[/B] $vcip";
-
Need to format ouput
Hi All,
I am trying to write wrapper for ptree in linux using pstree. I am ablet to get output something like tree format.
I need suggestions on how can I reformat output of pstree to look same as ptree in solaris.
Thanks
Manjuks -
How to display device error statistics in linux
Hi,
I am in a need of displaing device error statistics, is there any command in linux to do my job, like iostat -E does for Solaris?
Thanks in advance,
Manjunath -
Need kstat alternative in Linux
Hi All,
Is there any command like kstat (solaris) in linux? If not can you people guide me how I can write a script for the same...
Thanks & Regards,
Manju -
Hi thanks weaknessforcats and donbock.
I understood that the above code will not work, I just want to know weather mutex and semaphores are non preemptive?
Wont it these get interrupted in between?Leave a comment:
-
Seriliazing threads
Hi All,
I need some clarification on on mutex.
Is it possible to use an normal locking (As shown in below code) to serialize access to critical section in threads.
Code:int lock; if(lock!= 1){ lock++; //do something here lock--; }
-
Why sizeof is an operator rather than macro or function
Hi All,
Why sizeof is called as an operator, why it can not be function or a macro?
My assumption is type information is available at compile time, and to find out the size we need the type of object. Is it correct? or tell me why it must be an operator?
Thanks & Regards,
Manjunath -
Thanks a lot Bafna. Now I understood whats the problem, and solved it.
Thank you very much.
Thanks
ManjunathLeave a comment:
-
Hi Bafna,
Thanks for the reply...
Please have alook into the below full program.
Code:#include<stdio.h> #include<stdlib.h> void allocate2D(int** array, int nrows, int ncols) { /* allocate array of pointers */ printf("Allocating memory for array of pointers\n"); array = ( int** )malloc( nrows*sizeof( int* ) );
Leave a comment:
-
Problem in Free() on 2D array
Hi,
Please see the below code snipet, its giving segmentation fault while freeying array[i]. Anybody help in whats going wrong?
Code:void deallocate2D(int** array, int nrows) { /* deallocate each row */ int i; for(i = 0; i < nrows; i++) { printf("deallocate each row %d\n",i); free(array[i]); }
-
Hi,
Thanks a lot for your suggestions. I understood this properly.
Thanks,
ManjunathLeave a comment:
-
How this peice of code will execute?
Hi All,
What is happening in the below piece of code
Its printing Hello, why not world. Its working like call by value. Please clarify me on this.
int main()
{
char *temp = (char *)malloc(sizeof ("Hello" + 1));
strcpy(temp, "Hello");
fun(temp);
printf("temp = %s\n", temp);
return 0;
}
void... -
Need help in pointer
Hi All,
int *p = 100;
printf("%d\n", *p) //It will give segmentation fault
printf("%d\n", p) ; //It will print 100;
here *p behaving as normal variable. why so?
Thanks,
Manjunath -
That means, there is no library function like fprintf. We need to write our own function to accomplish this.
Thanks,
ManjunathLeave a comment:
No activity results to display
Show More
Leave a comment: