如何设置Aginity Workbench生成Unix格式文件(仅LF而非CR\LF)
Great question! Line-ending mismatches between Windows and Unix environments are such a common pain point—especially when dealing with version control like SVN. Here are a few reliable ways to get Aginity Workbench to output files with LF instead of CRLF, or work around the issue seamlessly:
1. Check Aginity Workbench's Built-in Settings
First, see if you can configure the app directly to use Unix-style line endings:
- Open Aginity Workbench and go to Tools > Options (depending on your version, this might be under File > Preferences).
- Navigate to the Editor or File Saving section. Look for a setting labeled Line Endings, Newline Format, or similar.
- If available, select Unix (LF) as the default option. From then on, any new or saved files will use LF line endings automatically.
2. Configure SVN to Handle Line Endings Automatically
If Aginity doesn’t have a built-in line-ending setting (some older versions don’t), let SVN do the heavy lifting for you. This avoids needing to run tr -d \r manually every time:
- Edit your SVN configuration file:
- On Windows:
%APPDATA%\Subversion\config - On Unix:
~/.subversion/config
- On Windows:
- Find the
[auto-props]section (uncomment it if it’s commented out) and add a rule for your file types (e.g., SQL files):[auto-props] *.sql = svn:eol-style=LF - This tells SVN to convert all
.sqlfiles to LF line endings when they’re committed to the repository. When you check out files on your Unix dev environment, they’ll already have LF endings—no post-processing needed. - If you want SVN to adapt to the OS but ensure consistency, you can use
svn:eol-style=nativeinstead, butLFis safer if your target environment is always Unix.
3. Post-Save Conversion Tools
If the above options don’t work, use a tool to convert CRLF to LF right after saving in Aginity:
- Install
dos2unixon Windows (via Chocolatey:choco install dos2unix). - Create a simple batch script that runs
dos2unixon the file you just saved in Aginity, then set it as an external tool in Aginity to run automatically on save. - Alternatively, use editors like VS Code or Notepad++ to re-save files in Unix format:
- VS Code: Click the "CRLF" indicator in the bottom-right corner, select "LF", then save.
- Notepad++: Go to Edit > EOL Conversion > Convert to Unix (LF).
Bonus: Fix Existing Repository Files
If you already have files in SVN with CRLF endings, you can fix them all at once:
- Set the
svn:eol-style=LFproperty on all existing files in the repository. - Update your local working copy—SVN will automatically convert the line endings to LF.
- Commit the converted files to the repository so future checkouts are consistent.
内容的提问来源于stack exchange,提问作者Petro

