For example “Conclusion” has two c but at different index. I am using It shows me only like “Accept”. I mean it shows me only these words are with side by side but i want to see here also “Conclusion” Answer If you plan to match lines that contain any two identical letters that are not necessarily consecutive, you can
Tag: unix
Find the closest match between two files in unix
As a beginner i’m looking for a solution in shell scripting, I have file1 with content as below lines: And file2 with filenames and their modified timestamp. I’m looking shell script solution where it can tell the closest match in timestamp in the between both files. Like timestamp_x and timestamp_y comes in between timestamp_1 and timestamp_2. Thanks Answer If your
Creating a symbolic in shared volume of docker and accessing it in host machine
I am creating a symbolic link in mounted volume of a host machine inside a docker. But I am unable to access it in host machine. Is it possible to do it. If yes how can I do that. I used the following command to mount directory Then I created a symbolic link using Now when I am trying to
How to connect to SQLPLUS and run SQL script within ssh unix?
I have the following bash script: Now, I want to run te following sql script (which is on the other device I’m accessing): How is the best practice to run the script from that path? I’ve seen a suggestion to add “/usr/mikael/myfile.sql” to the end of the command, as : Is that really good? (I’m working on a prod environment
How to displays the owner privileges of the files in the current directory in linux os?
I want to displays the owner privileges of the files in the current directory For example the output like this : I’m trying to write this command , but the output is not correct : Answer You just do this command :
How can I loop for end of month date between to dates in sh?
I want to loop and print end of month date between two dates. I have below code but it prints day on day. but I want these result for: 20210131 20210228 20210331 thanks in advance Answer Something like this or with -m flag
Name check match pattern
I need help as to why code B is producing a different result The code below (CODE A) produces the correct output (match) However, the below (CODE B) produces a wrong output (no match) Answer To check a regex in an if-statement you’ll need to use =~ instead off ==; Both will match as expected. Try it online!
Redirect file in linux using length [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question Am trying to redirect the file based on the length. I have a file having the value, I like Linux I have to create a
pass the date from outside as a parameter
This is my Linux script, I want to ask the user from outside what date is needed, then save that date and run the script for that date. now currently this script generate a csv for the current date files, I want to run this for a user request date, can I pass parameters from outside? any help could be
Finding Duplicate rows based on a column in Unix File
I have a file of about 1 Million records. I need to extract the records which have different FName and LName for id. Input File The result that I want to see Any AWK or Sed command or script can help? Thanks Answer Using GNU awk for arrays of arrays: or if your input file is sorted by “id” as