The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 09-06-2007
radoulov's Avatar
radoulov radoulov is offline
addict
 

Join Date: Jan 2007
Location: Milano, Italia/Варна, България
Posts: 2,020
Code:
zsh 4.3.4% cat file
34
45
56
77
55
66
54
67
zsh 4.3.4% eval printf "%d\\\n" $(printf "\$((%d-1)) " $(<file))
33
44
55
76
54
65
53
66
or:

Code:
zsh 4.3.4% awk '$1=$1-1' file
33
44
55
76
54
65
53
66
Reply With Quote