Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch script does not work with BSD sed #32

Open
fxcoudert opened this issue Nov 22, 2022 · 0 comments
Open

Patch script does not work with BSD sed #32

fxcoudert opened this issue Nov 22, 2022 · 0 comments

Comments

@fxcoudert
Copy link

On macOS, or another BSD system, patching does not succeed:

$ ./patch_lammps.sh $HOME/lammps
Copying files...
Updating CMakeLists.txt...
sed: 1: "/Users/fx/lammps/cmake/ ...": invalid command code f
Done!

Note the sed error, that's because BSD sed expects an argument after -i:

NAME
     sed – stream editor

SYNOPSIS
     sed [-Ealnru] command [-I extension] [-i extension] [file ...]
     sed [-Ealnru] [-e command] [-f command_file] [-I extension] [-i extension] [file ...]

Specifying a suffix is the only way to make the command work for both BSD and GNU sed.

# Update CMakeLists.txt
sed -i.bak "s/set(CMAKE_CXX_STANDARD 11)/set(CMAKE_CXX_STANDARD 14)/" $lammps_dir/cmake/CMakeLists.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant