Reverse match in grep

root@localhost# echo 'server $serviceName -connectorType $connectorType -ipAddress $ipAddress -port $port -domain $domain' | cut -d "-" -f 1

O/P= server $serviceName

when i grep the o/p -v nothing is displayed
now how to output the all data by excluding the O/P (server $serviceName) from the data which i entered in the echo command.

the o/p should look like

-connectorType $connectorType -ipAddress $ipAddress -port $port -domain $domain
... | sed 's/server $serviceName//'
echo 'server $serviceName -connectorType $connectorType -ipAddress $ipAddress -port $port -domain $domain' | sed 's/^[^-]*//'

Jean-Pierre.

Thanks aigles and zaxxon. its works fine.

i had a samall doubt what does the char ^ in sed command mean sed 's/^[^-]*//'

Or try as

echo 'server $serviceName -connectorType $connectorType -ipAddress $ipAddress -port $port -domain $domain' | cut -d " " -f3-
 
^ -- begining of line
 
[^] -- negate the meaning.
 
So [^-] -- except "-" if any thing else comes

An example better expalins:

 
SCRIPTS>cat input_file
-dsdsd
ds-dsds
avalon:/disk3/upat/SCRIPTS>sed 's/^[^-]*//' input_file
-dsdsd
-dsds