After upgrading my Mac OS install some previous
sed commands do not work for me:
GMC03-calculations $echo $line_no 849 GMC03-calculations $cat corr.in 269 # number of clusters 845 # number of configurations clusters ... ...
I would like to replace the 845 (this is not a constant) into
$line_no (in this case 849)
GMC03-calculations $sed -i '' 's/^[.0-9]* # number of configurations$/'"$line_no"' # number of configurations/' corr.in sed: can't read s/^[.0-9]* # number of configurations$/849 # number of configurations/: No such file or directory
the following command works previously but not now.... very strange... I have installed sed using home-brew..... G
MC03-calculations $brew install sed Error: No available formula with the name "sed" ==> Searching for similarly named formulae... These similarly named formulae were found: gnu-sed ✔ libxdg-basedir minised ssed To install one of them, run (for example): brew install gnu-sed ✔ ==> Searching taps... These formulae were found in taps: Caskroom/cask/focused Caskroom/cask/licensed Caskroom/cask/marsedit Caskroom/cask/physicseditor Caskroom/cask/subclassed-mnemosyne To install one of them, run (for example): brew install Caskroom/cask/focused
Any idea what might be happening? Thank you.