Discussion:
the basenale of a file
David D
2002-01-08 19:20:19 UTC
Permalink
I m sorry i m so idiot.
I try to retrieve the basename of a file without the ./ which mwas return me
froma find command
I try a test :

set a = "./mail"
set a =basename $a
echo `$a`

nothing I try without '', $a mean the value into a ?


a+.
Paul Jarc
2002-01-08 19:25:41 UTC
Permalink
Post by David D
I m sorry i m so idiot.
I try to retrieve the basename of a file without the ./ which mwas return me
froma find command
set a = "./mail"
set a =basename $a
echo `$a`
You aren't speaking sh (nor bash). The "set" command has nothing to
do with what you want; whitespace around "=" matters; you seem to have
your backquotes in the wrong place.
a="./mail"
a="`basename "$a"`"
echo "$a"
Post by David D
nothing I try without '', $a mean the value into a ?
I don't understand this question.


paul
David D
2002-01-08 19:53:48 UTC
Permalink
tomd = "`echo "$REP"/mail`"

echo $tomd

How did u do to make string concat ?

echo $REP/mail
# give something good but i want to retrieve it into a var

What I need I think is truely a memento of must useful bash command !
Paul Jarc
2002-01-08 19:57:58 UTC
Permalink
Post by David D
tomd = "`echo "$REP"/mail`"
As I said, whitespace around "=" matters.
tomd="`echo "$REP"/mail`"
Post by David D
echo $tomd
How did u do to make string concat ?
I don't understand this question.

For further help with scripting, please go to news:comp.unix.shell.
This mailing list is for bash bugs. Your questions aren't about bugs
and aren't bash-specific.


paul
David D
2002-01-08 20:45:47 UTC
Permalink
I mean concatenate.
Thanks for the properly newsgroups.

David D
2002-01-08 19:31:43 UTC
Permalink
thanks again paul :

I didnt manage to keep the bash logical into my mind, I note that :
a="./mail"
a=`basename $a`
echo $a
works too.
so "fdjsh" mean a string
`command ....` -> give the result of command, there so important !

thanks again.
Loading...