Skip to content
Advertisement

Tag: unix

sbrk system call in unix

I studied like malloc uses the sbrk system call. But, some one says, the sbrk is deprecated one. Now a days malloc using the mmap2 system call to allocate memory. So, Is there any commands like (ls,cat, grep, sed) using the sbrk system call. For Ex: The above output shows that the ls command using the above syscall to execute

SIZE command in UNIX

The following is my C file: It contains only return statement. But if I use the size command, it shows the output like this: Even though my program does not contain any global variable, or undeclared data. But, the output shows data segment have 252 and the bss have 8 bytes. So, why the output is like this? what is

Unix – Uncomment xml comments

I have below node from XML file. How do I uncomment the first occurrance of mainHost using Unix shell script or commands? I have tried with below command with different variations but that does not seem to work. sed ‘0,/<!– /{s/<!– //}’ /test.xml I am expecting below output Thanks Answer You were on the right track (under the assumption that

Make a program in path preferable instead of another

There is a program in the PATH variable installed by root, but I installed a more recent version in my local. There is any way to make my program preferable instead of the root? Sorry for my bad english. Answer put the preferred directory in front of the other one. It will pick up the first one it finds.

Converting values from for loop to json format

Below is a snippet of a for loop where I sort txt file names. I am then trying to save the results in a json format file. However it results in an invalid json format due to the last , inserted in obj. How could i convert to json format the values from the for loop? script Desired output Current

searching through text file in terminal

Hi this might be a basic question for many, but it has however managed to eat a couple of hours of my time. I have large data file as an output from running a script. The file contains around 15 columns and around 100,000 rows. I wish to search through the file and in columns 4,5,6,7 and 8 check for

Advertisement