On Tue, Dec 30, 2008 at 8:01 PM, Oleg Goldshmidt wrote:
> "Erez D" writes:
>
> > Frankly, the exact requirements were not clear from your post (it is
> > a
> > coincidence that the solution I offered works for the revised
> > requirements as well).
> >
> > btw, it didn't
>
>
"Erez D" writes:
> Frankly, the exact requirements were not clear from your post (it is
> a
> coincidence that the solution I offered works for the revised
> requirements as well).
>
> btw, it didn't
This only means that I don't understand the requirements. Cutting and
pastin
On Tue, Dec 30, 2008 at 6:49 PM, Oleg Goldshmidt wrote:
> "Erez D" writes:
>
> > this is a solution speceific to the .txt being preceided by the 000.
> > (it will not work on path/input_000_xyz.txt).
>
> Why not? "basename ${foo/*input_/} _xyz.txt" will do it.
>
> Frankly, the exact requirements
"Erez D" writes:
> this is a solution speceific to the .txt being preceided by the 000.
> (it will not work on path/input_000_xyz.txt).
Why not? "basename ${foo/*input_/} _xyz.txt" will do it.
Frankly, the exact requirements were not clear from your post (it is a
coincidence that the solution I
On Sun, 28 Dec 2008 13:21:59 Erez D wrote:
>
> On Sun, Dec 28, 2008 at 12:00 AM, Oleg Goldshmidt wrote:
>
> > >>
> > >> $ basename ${foo/*input_/} .txt
> > >>
>
> this is a solution speceific to the .txt being preceided by the 000.
> (it will not work on path/input_000_xyz.txt).
>
> i just wanted t
On Sun, Dec 28, 2008 at 12:00 AM, Oleg Goldshmidt wrote:
> On Sat, Dec 27, 2008 at 10:47 PM, Erez D wrote:
> >
> >
> > On Fri, Dec 26, 2008 at 11:15 PM, Oleg Goldshmidt
> > wrote:
> >>
> >> Well, if you insist, assuming that all the files have
> >> "input_" in the beginning, you can use
> >> ${p
On Sat, Dec 27, 2008 at 10:47 PM, Erez D wrote:
>
>
> On Fri, Dec 26, 2008 at 11:15 PM, Oleg Goldshmidt
> wrote:
>>
>> Well, if you insist, assuming that all the files have
>> "input_" in the beginning, you can use
>> ${parameter/pattern/string} substitution, e.g., for string $foo use
>>
>> $ bas
On Fri, Dec 26, 2008 at 11:15 PM, Oleg Goldshmidt wrote:
> On Thu, Dec 25, 2008 at 2:08 PM, Erez D wrote:
>
> > The problem is that the file's path varies, so the offset changes.
> > i could use basename for removing the path, however i could also use sed
> >
> >
> >
> >
> >>
> >> Why do yo
On Thu, Dec 25, 2008 at 2:08 PM, Erez D wrote:
> The problem is that the file's path varies, so the offset changes.
> i could use basename for removing the path, however i could also use sed
>
>
>
>
>>
>> Why do you want it in one command ?
>
> i do not like to use temporary variables (or f
On Thu, Dec 25, 2008 at 12:49 PM, Valery Reznic wrote:
>
>
>
> --- On Thu, 12/25/08, Erez D wrote:
>
> > From: Erez D
> > Subject: bash q -substitution
> > To: "linux-il"
> > Date: Thursday, December 25, 2008, 11:20 AM
> > hi
> >
&g
--- On Thu, 12/25/08, Erez D wrote:
> From: Erez D
> Subject: bash q -substitution
> To: "linux-il"
> Date: Thursday, December 25, 2008, 11:20 AM
> hi
>
> i need to convert a string using bash
>
>
> input_000.txt -> i need to extract the 000
For
hi
i need to convert a string using bash
input_000.txt -> i need to extract the 000
using sed i would do : sed 's/^.*_//ls/\.txt$//'
using bash i can do in two lines:
(assuming input-string is stored in variable 'i' )
x=${i##*_}
result=${x%%.txt}
can it be done in bash in one line ? (i.e. c
12 matches
Mail list logo