Sponsored Content
Top Forums Shell Programming and Scripting Logic to separate the first name in the file Post 302999050 by ricky-row on Monday 12th of June 2017 11:26:04 PM
Old 06-13-2017
Logic to separate the first name in the file

Hi any logic to write a shell script to go back up into the previous directory and it has "n" number of files like abc-1.0.1.rpm , xyz-3.2.1.rpm , a-bd-2.3.1.rpm etc.. with same pattern. I need the first name of it before the numeric starts (which can acts as a delimiter) i.e(-1.0.1)

Kindly share your inputs.

I have a directory called test with files abc-1.1.rpm, bdf-2.12.rpm, xz-y-1.02.rpm xyz-3.2.1.rpm , a-bd-2.3.1.rpm, etc.. let be "n" files. I am going to write a script in test/testscript.sh. here this script should come out and check for the files and give me the output to a file with abc,bdf,xz-y. the file can be n numbers.
 

We Also Found This Discussion For You

1. Shell Programming and Scripting

Shell script (sh file) logic to compare contents of one file with another file and output to file

Shell script logic Hi I have 2 input files like with file 1 content as (file1) "BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt File 2 contents as fle(2) "BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt I want to get... (22 Replies)
Discussion started by: pottic
22 Replies
All times are GMT -4. The time now is 05:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy