Sponsored Content
Top Forums Shell Programming and Scripting Logic to separate the first name in the file Post 302999065 by ricky-row on Tuesday 13th of June 2017 04:00:54 AM
Old 06-13-2017
Its just near to the output, My idea is to make the delimiter to check from the front, because the output for thsi file is server-7.10.1-1-xyz-gbc.rpm is server-7.10.1 but I need only server, I am also trying with different style but I am just a beginner I can make use of it. could you change the code once again according to this please

---------- Post updated at 01:30 PM ---------- Previous update was at 12:29 PM ----------

I got the answer thanks, for the help Aia

Code:
for f in ../*rpm; do echo "$f" | sed 's/-[0-9].*//'; done

this code works for me fine

Last edited by rbatte1; 06-13-2017 at 01:01 PM.. Reason: Added CODE tags
 

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
isympy(1)																 isympy(1)

NAME
isympy - interactive shell for SymPy SYNOPSIS
isympy [-c | --console] isympy [ {-h | --help} | {-v | --version} ] DESCRIPTION
isympy is a Python shell for SymPy. It is just a normal python shell (ipython shell if you have the ipython package installed) that exe- cutes the following commands so that you don't have to: >>> from __future__ import division >>> from sympy import * >>> x, y, z = symbols("xyz") >>> k, m, n = symbols("kmn", integer=True) So starting isympy is equivalent to starting python (or ipython) and executing the above commands by hand. It is intended for easy and quick experimentation with SymPy. For more complicated programs, it is recommended to write a script and import things explicitly (using the "from sympy import sin, log, Symbol, ..." idiom). OPTIONS
-c shell, --console=shell Use the specified shell (python or ipython) as console backend instead of the default one (ipython if present or python otherwise). Example: isympy -c python FILES
${HOME}/.sympy-history Saves the history of commands when using the python shell as backend. BUGS
The upstreams BTS can be found at <http://code.google.com/p/sympy/issues/list> Please report all bugs that you find in there, this will help improve the overall quality of SymPy. SEE ALSO
ipython(1), python(1) 2007-10-8 isympy(1)
All times are GMT -4. The time now is 06:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy