I am not able to parse the following

hi all,

echo $TOOL_HOME | cut -c1-1`"

What is the meaning of the cut statement above .
Sorry if it looks silly, but my understanding of -c is
output only the following characters,

But here I see 1-1'"

What could be that ?
parag_paul [ Mo, 05 November 2007 21:07 ] [ ID #1862406 ]

Re: I am not able to parse the following

parag_paul [at] hotmail.com wrote:
> hi all,
>
> echo $TOOL_HOME | cut -c1-1`"
>
> What is the meaning of the cut statement above .
> Sorry if it looks silly, but my understanding of -c is
> output only the following characters,
>
> But here I see 1-1'"
>
> What could be that ?
>

a typo.
Ed Morton [ Mo, 05 November 2007 21:16 ] [ ID #1862407 ]

Re: I am not able to parse the following

In article <_oKdna9wmOOa57LanZ2dnUVZ_uPinZ2d [at] comcast.com>,
Ed Morton <morton [at] lsupcaemnt.com> wrote:

> parag_paul [at] hotmail.com wrote:
> > hi all,
> >
> > echo $TOOL_HOME | cut -c1-1`"
> >
> > What is the meaning of the cut statement above .
> > Sorry if it looks silly, but my understanding of -c is
> > output only the following characters,
> >
> > But here I see 1-1'"
> >
> > What could be that ?
> >
>
> a typo.

Or it's not the whole thing. Those look like the closing back-tick and
double-quote of a quoted command substitution. E.g. something like:

FIRST_CHAR="`echo $TOOL_HOME | cut -c1-1`"

will set FIRST_CHAR to the first character of $TOOL_HOME. Double-quote
and back-tick are used in matched pairs.

--
Barry Margolin, barmar [at] alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Barry Margolin [ Di, 06 November 2007 08:35 ] [ ID #1863285 ]

Re: I am not able to parse the following

Barry Margolin wrote:
> In article <_oKdna9wmOOa57LanZ2dnUVZ_uPinZ2d [at] comcast.com>,
> Ed Morton <morton [at] lsupcaemnt.com> wrote:
>
>
>>parag_paul [at] hotmail.com wrote:
>>
>>>hi all,
>>>
>>>echo $TOOL_HOME | cut -c1-1`"
>>>
>>>What is the meaning of the cut statement above .
>>>Sorry if it looks silly, but my understanding of -c is
>>>output only the following characters,
>>>
>>>But here I see 1-1'"
>>>
>>>What could be that ?
>>>
>>
>>a typo.
>
>
> Or it's not the whole thing. Those look like the closing back-tick and
> double-quote of a quoted command substitution. E.g. something like:
>
> FIRST_CHAR="`echo $TOOL_HOME | cut -c1-1`"
>
> will set FIRST_CHAR to the first character of $TOOL_HOME. Double-quote
> and back-tick are used in matched pairs.
>

That'd be a very odd way to write it, though, compared to:

FIRST_CHAR=`echo "$TOOL_HOME" | cut -c1`

Ed.
Ed Morton [ Di, 06 November 2007 12:38 ] [ ID #1863296 ]

Re: I am not able to parse the following

In our last episode, the evil Dr. Lacto had captured our hero,
"parag_paul [at] hotmail.com" <parag_paul [at] hotmail.com>, who said:

>echo $TOOL_HOME | cut -c1-1`"

is not the same as

>But here I see 1-1'"

>What could be that ?

Perhaps this is one line in a longer command pipeline?

--hymie! http://lactose.homelinux.net/~hymie hymie [at] lactose.homelinux.net
------------------------ Without caffeine for 372 days ------------------------
hymie_ [ Mi, 07 November 2007 14:00 ] [ ID #1864308 ]
Linux » comp.unix.shell » I am not able to parse the following

Vorheriges Thema: [zsh] completion system
Nächstes Thema: find -exec using <<!EOF