在bash编程中如果VAR="/home/somestuff/work/OutExample/Air"
,
如何获得"workOutExampleAir"
?
由于
答案 0 :(得分:0)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.four_main_free_vib);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
if((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE){
TextSize_Value_NormalText = 22;
TextSize_Value_BiggerText = 84;
ResizeHintter(et_INI_V, 84, 30);
ResizeHintter(et_INI_D, 84, 30);
ResizeHintter(et_D, 84, 48);
ResizeHintter(et_S, 84, 48);
ResizeHintter(et_M, 84, 48);
} else if((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE) {
TextSize_Value_NormalText = 16;
TextSize_Value_BiggerText = 54;
} else if((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL) {
TextSize_Value_NormalText = 12;
TextSize_Value_BiggerText = 34;
ResizeHintter(et_INI_V, 42, 14);
ResizeHintter(et_INI_DT, 42, 14);
ResizeHintter(et_D, 42, 14);
ResizeHintter(et_S, 42, 14);
ResizeHintter(et_M, 42, 14);
} else if((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_SMALL) {
TextSize_Value_NormalText = 8;
TextSize_Value_BiggerText = 22;
} else {
TextSize_Value_NormalText = 12;
TextSize_Value_BiggerText = 36;
}
}// onCreate(Bundle).
void ResizeHintter(final EditText et, final int OriginalSize, final int HintSize){
et.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
// TODO Auto-generated method stub
et.setTextSize(TypedValue.COMPLEX_UNIT_DIP, HintSize);
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
// TODO Auto-generated method stub
if(s.length() == 0){
// No entered text so will show hint
et.setTextSize(TypedValue.COMPLEX_UNIT_DIP, HintSize);
et.setPadding(0, 0, 0, 0);
} else {
et.setTextSize(TypedValue.COMPLEX_UNIT_DIP, OriginalSize);
et.setPadding(0, 0, 0, 0);
}
}
});
}
剪切实用程序从4开始使用带分隔符/
的字段 bash 中的
cut -f4- -d/ --output-delimiter "" <<< "$var"