This below shows this some lines of csv file, i want to get the results that only get the Population column with only using grep command. results i want: The command i made for this problem was which got results below how can i get rid of the rest of things without using awk sed or any other things? Answer
Tag: unix
Use values in a column to separate strings in another column in bash
I am trying to separate a column of strings using the values from another column, maybe an example will be easier for you to understand. The input is a table, with strings in column 2 separated with a comma ,. The third column is the field number that should be outputted, with , as the delimited in the second column.
How to call another shell script from a shell script in Linux
I am trying to create one wrapper script to trigger the parent script at 6AM only. But it is not properly working. It always showing Do Nothing and else part is looping without exit. Can any one help? I want to check if the time is 6 AM and also need to check the string from text file(status). if both
How to delete a subfolder with only a single file under the parent folder [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question
Why is my envsubst command just inserting blank strings?
I’m trying to run the command envsubst < myfile to replace environment variables but instead of being replaced with their values, they are being replaced with blank strings. Here’s my example command (split onto separate lines for clarity): Here are my results: I’m clearly doing something obvious wrong, I just have a silly suspicion it’s one of those things that
How to split a text file into blocks with 10+ characters without dividing words using sed in Linux?
I want to come up with a sed command where once every 10 character will look for the nearest space and substitute it with “|” I tried sed -E -e ‘s/ /|/( *?[0-9a-zA-Z]*){10,}’ new.file, but it shows errors. Example input: Expected Output: Answer This works for given sample: (.{10}[^ ]*) this matches 10 characters, followed by any non-space characters then
In Linux Shell, how to find out which commands I use most often and how often?
I want to find out which are the top 5 commands that I ran in the shell. I want to see which commands I use most often. It would be great if I can also see how often I ran these top commands. Is there an easy way to find it without installing any plugins? Answer You can do it
How to run bash commands from Python preferably with the os library?
I am trying to run the following python script named test.py. It contains multiple bash commands which I would like to execute in a Linux terminal (unix). This is the content of the file: I am running the Python script using the following in the terminal: The problem that I have is that the commands do not run the same
Traversing a directory using Makefile
I am making use of a makefile to traverse a directory , store the file names in a variable , extract the file number using regex and print the file number . Below is the code block I am using : LINE 7 is the command in makefile I want to include in the for loop. I want the actual
Filter output of git diff-tree based on file extension
gives me the list all the files that were committed for that SHA. I am looking for a way to get a list of files with only .xml or .html extensions. I checked the documentation page – here and couldn’t see any option. Any help is greatly appreciated. Answer You can use — <path> [<otherpath> …] for this : Be