Shell : how to add number from another

Hi,

I want to know how i can add variable from grep -n value with another value (enter manualy) :
this is my example

cat fileName | grep -i "pattern" -n $(cat fileName | grep -i "pattern" | sed -n 's/^\([0-9]*\)[:].*/\1/p')+ 1

Reply

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
More information about formatting options