package vote.utils; import java.security.MessageDigest; import java.text.SimpleDateFormat; import java.util.Date; //数字字符转数值格式 public class ConvertUtil { public int strToInt(String str) { int i = 0; try { if (str != null) i = Integer.parseInt(str); }
Usage: bash judge_prefix_string.sh TARGET_DIR TARGET_STR #!/bin/bash TARGET_DIR=$1 TARGET_STR=$2 ls $TARGET_DIR/$TARGET_STR* if [ $? -ne 0 ];then echo "file begin with $TARGET_STR is not existed!" else echo "file begin with $TARGET_STR is e