Details
Details
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
The purpose of the awk is to trim a single leading-tab from the input.
The reason for doing that is because the input should be indented by a single leading-tab and it is not.
The reason the here-doc text is not indented is because someone is ignoring the fact that we should be indented because we are in an if-then-else-fi block.
This makes the code harder to read. We should improve the readability of the code.
I would actually prefer to change it in this way:
awk 'sub(/^\t/,"")||1' \ >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<EOF network={ ssid="$NETWORK" scan_ssd=$SCANSSID key_mgmt=NONE priority=5 } EOF
Should be (for example):
awk 'sub(/^\\/,"")||1' \ >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF network={ \ ssid="$NETWORK" \ scan_ssid=$SCANSSID \ key_mgmt=NONE \ priority=5 } EOF
Three things are being done:
- Instead of trimming a leading tab, we trim a leading backslash
- We change <<EOF to <<-EOF so that leading tabs are eaten
- We place a backslash before any leading tab that we want to preserve (for only the first tab where we want the line to start)
Comment Actions
If you have a preferred fix please commandeer this revision and update the new patch.