I am looking for some advice on the following below: I have several applications and tools on a server that requires the environment to be set up with variables etc for them to run. Many of these applications use the same environment variables to run but with different values. Some of these applications have multiple versions. e.g. prog v1.1, prog
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.
Reading through a text file line by line and checking if that line has a certain string
I am trying to read a text file line by line using Shell Scripting. What I have been doing is If you have any suggestions please let me know! I am open to other options because I have been trying to do this way too long. TO CLARIFY: I am going through a file line by line (while loop) then
How to handle missing values while calculating average in shell script?
I have a dataset with many missing values as double slash (//). Part of the data is I would like calculate the average in each 6 rows interval without considering the missing values. I was trying with this, but not getting what I need. It is giving But the answer should come Answer You need to modify the awk a
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
The Majority of Unix tools are written in what programming language? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 7 years ago. Improve this question Here is an example of using two Unix tools: ls and grep are two Unix tools. I believe that both
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