Skip to content
Advertisement

Tag: script

run a command with a file pattern

I have this file patterns.txt And I want to run a specific command for every pattern like this: I tried to used for loop like this: but i didn’t work Answer The 2 typical approaches are: and Note that I would expect both of those to fail, since scp expects at least 2 arguments. How you want that 2nd argument

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

Advertisement