Skip to content
Advertisement

Tag: unix

How to find the lines that include same two letters by using grep?

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

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

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

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

Advertisement