Note that there are some explanatory texts on larger screens.

plurals
  1. POScript to extract a range of lines from a file in bash
    primarykey
    data
    text
    <p>I have this code</p> <pre><code>week=`date +%V_%d` date=`date +%d%m%y` #Cat to a file let tamano=`cat Prenum` file="White_prepago_${date}.txt" name="base_prepago_paqu_w$week_" cat WhiteList.txt | grep ",0" | sed '/^57/!s/^/57/' | awk '{FS=","}{print $1}'&gt; $file # the number of lines of the file let numlines=$2 #Must begin in the line in the file let lines=$tamano+$2 num=$3 for ((i=1; i&lt;=$num; i++)) do let d=$4+$i cat $file | head -$lines | tail -$numlines &gt; base_$d let lines=$lines+$numlines done let lines=$lines-$numlines echo $lines&gt;Prenum </code></pre> <p>I am executing this code in a VM with Linux and works, and now i am intenting run this code in a Solaris Machine but not works, In solaris the file run but not works fine because create the number of files that i write but all my files are the seim, and in linux create all my files but with the increment. The code have to split a file in the lines that i write</p> <p>for example</p> <pre><code> bash script.sh 5000 3 0 </code></pre> <p>This code create 3 files of 5000 lines since base_1 from the file: base_prepago_paqu_w$week_". I am not using split because i need read the number in the file Prenum or Posnum.</p> <p>In the file Prenum there is a number </p> <pre><code>$cat Prenum 5008971 </code></pre> <p>And the code select a range of the file for example if the number is: 5008971 and i write <code>bash script.sh 5000 3 0</code> the output are 3 files from the line 5008971+5000 to 5008971+15000.</p> <p>Could you please help me with my problem?, or with other idea that works in solaris?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload