sed "s/public \(.*\) get\(.*\)()/\1 \2/g"
이
public class ChallengeTO extends AbstractTransferObject {
AuthAlgorithm Algorithm;
long Code;
int Iteration;
String PublicKey;
String Selt;
};
I 변경할
publicKey
-Algorithm
에 algorithm
, PublicKey
과에이
public class ChallengeTO extends AbstractTransferObject {
public AuthAlgorithm getAlgorithm();
public long getCode();
public int getIteration();
public String getPublicKey();
public String getSelt();
};
을 transfor합니다 곧. 두 번째 세그먼트 (\2
)의 첫 번째 문자를 소문자로 변환하려면 어떻게해야합니까?
UPDATE
sed "s/public \(.*\) get\([A-Z]\)\(.*\)()/\1 \2\3/g"
는 \2
로 "내 편지"를 선택하지만 내가 전에 \L
을 배치하면 그것은 너무 많은 여기
나는 sed one-liner가 내 문제를 해결해야한다고 생각한다. 나는 sed 방법이 너무 복잡 해지면 awk에 가지 않을 것이다. – Notinlist
오케이, 그래서 당신은 sed 한 라이너 싶어. 업데이트를 참조하십시오. – ghostdog74