Shell中大小寫互換
今天需要寫個shell,建立hive的分割槽表,因為配置中的表名都是大寫,但是HDFS的路徑對大小寫敏感,需要將所有的表名轉換為小寫,那麼就需要用到tr來處理了:
table=`echo $line | tr '[:upper:]' '[:lower:]'` #大寫轉小寫
table=`echo $line | tr '[:lower:]' '[:upper:]'` #小寫轉大寫
#!/bin/bash startdate=$1 enddate=$2 cat hivetablelist | while read line do table=`echo $line | tr '[:upper:]' '[:lower:]'` #大寫轉小寫 sh create.sh $startdate $enddate $table echo $table done
相關推薦
Shell中大小寫互換
今天需要寫個shell,建立hive的分割槽表,因為配置中的表名都是大寫,但是HDFS的路徑對大小寫敏感,需要將所有的表名轉換為小寫,那麼就需要用到tr來處理了:table=`echo $line | tr '[:upper:]' '[:lower:]'` #大寫轉小寫 table=`echo $line
shell中大小寫轉換
1, 用tr 例如:UPPERCASE=$(echo $VARIABLE | tr '[a-z]' '[A-Z]') (把VARIABLE的小寫轉換成大寫) LOWERCASE=$(echo $VARIABLE | tr '[A-Z]
SQL中大小寫轉換
ges images log 字段名 one mage tor sql com 1一. 轉換為大寫 2 3UPPER(字段名或變量名) 4 5二. 轉換為小寫 6 7LOWER(字段名或變量名) 8 9三. 示例 1011SELECT upper(‘a‘),low
Shell中大括號“{}”的使用方法
Shell中大括號"{}"的使用 一. 擴充套件 {. .}自動補全 、{, , ,} {. .}自動補全 (1) echo {1. .5}會將1,2,3,4,5都打印出來( “. .”自動補全)。 (2) touch class1_linux{1. .5
求字串中大小寫數字的個數
@求字串中大小寫數字的個數 public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("請輸入一個字串"); St
Navicat for MySQL工具中大小寫敏感的情況下表名稱會出現變小寫
不知道大家有沒有用Navicat for Mysql 工具操作資料庫,我感覺蠻好用的,但是不知道你們有沒有發現,往指定的庫中匯入sql檔案時,表名竟然不區分大小寫了,真鬱悶!
java中大小寫轉換相關問題
package com.captain.大小寫轉換; public class Test { public static void main(String[] args){ // 大寫轉換成小寫
java中大小寫字母轉換
import java.util.*; import java.io.*; public class Main {public static void main(String[] args) {Sca
在Navicat for MySQL工具中大小寫敏感的情況下表名稱會出現變小寫的情況,如何改回大寫呢
(1) 問題描述 1﹚ 在Navicat for mysql 修改過表名之後表在後續的跟進中會把表名在未知情況下變成小寫的. 2﹚ 在大小寫敏感情況下,對欄位中該大寫的字母修改之後發現說
python中大小寫字元轉換及字元判斷
和其他語言一樣,Python為string物件提供了轉換大小寫的方法:upper() 和 lower()。還不止這些,Python還為我們提供了首字母大寫,其餘小寫的capitalize()方法,以及所有單詞首字母大寫,其餘小寫的title()方法。函式較簡單,看下面的
mssql中大小寫的區分
1.--區分大小寫 select * from a where a=’AbCdE’ collate Chinese_PRC_CS_AI--區分大小寫 select * from a where a=’abCdE’ collate Chinese_PRC_CI_AI--不區分
Shell實現數字互換和字母大小寫互換
檔案內容如下: 123abc456 456def123 567adc789 789def567 要求輸出: 456ABC123 123DEF456 789ADC567 567DEF789 實現程式碼如下: #!/bin/bash while read line do
自定義資料屬性中大小寫
HTML5規定可以為元素新增非標準的屬性,但要新增字首data-,目的是為元素提供與渲染無關的資訊,或者提供語義資訊。這些屬性可以任意新增、隨便命名,只要以data-開頭即可。新增完自定義屬性後,可以通過元素的dataset屬性來訪問自定義屬性的值。dataset屬性的值是DOMStringMap的一個例項,
MySQL中大小寫區分問題
MySQL在Linux下資料庫名、表名、列名、別名大小寫規則是這樣的: 1、資料庫名與表名是嚴格區分大小寫的; 2、表的別名是嚴格區分大小寫的; 3、列名與列的別名在所有的情況下均是忽略大小寫的; 4、變數名也是嚴格區分大小寫的; MySQL在Windows下都不區
java中大小寫的判斷總結
在java中是嚴格區分大小寫的,這一點也和C語言一樣 基本的規則 1,專案名全部小寫 2,包名全部小寫 3,類名首字母大寫,如果有多個單詞,每個單詞的首字母都需要大寫 例如:public class HelloWord{}; 4,變數名,方法名首字母
[Shell]將字串轉化為大寫/小寫
1.使用tr命令 echo "Xin Zi Zhi" | tr '[A-Z]' '[a-z]' 輸出結果:$xin zi zhi echo "Xin Zi Zhi" | tr '[a-z]' '[A-Z]' 輸出結果:$XIN ZI ZHI 2.使用typeset定義
確保字符串的每個單詞首字母都大寫,其余部分小寫
itl char title 空格 ttl fun code har case 代碼如下:function titleCase(str) { //將字符串轉化為數組並將其小寫化 var arr = str.toLowerCase().split(" ");
完全備份數據和差異備份數據的shell腳本
完全備份數據和差異備份數據的shell腳本#!/bin/bash # # Description: 該腳本功能,以周為單位循環;周五實行完全備份,周六不備份,周日至周四實行差異備份; # 因工作需要,不實行壓縮打包的方式,采用cp完全備份,rsync差異備份; #
shell 測試URL 是否正常腳本
shell腳本 測試頁面是否正常腳本 題目:老男孩教育每日一題-2017年5月3日-寫一個腳本:創建一個函數,能接受兩個參數題目要求1)第一個參數為URL,即可下載的文件;第二個參數為目錄,即下載後保存的位置;2)如果用戶給的目錄不存在,則提示用戶是否創建;如果創建就繼續執行,否則,函數返回一個51的
SSH Secure Shell顯示serverTomcat後臺內容
clas art span rgb linux tomcat cat 文件內容 顯示 作為linux小白,僅僅有學一點記一點了: 部署server的時候。常常須要向本地一樣查看控制臺輸出,在linux上能夠通過查看日誌輸出替代,當然也能夠通過命令讓日誌實時顯示在命令窗