The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 11-20-2008
elbrand elbrand is offline
Registered User
  
 

Join Date: Apr 2008
Location: Wolfenbuettel/Germany
Posts: 12
Can i use Variables in sed command in line numbers

why not calculate the line numbers outside of the sed-script?

#! /bin/bash
typeset -i A=1 B=A+5
sed -n "${A},${B} p" file.txt