1.-bash:./dd.sh:/bin/bash^m:bad Interpreter: No file or directory
When the above problem arises, first look at your. Profile is configured correctly, the general configuration is: path= $PATH: $HOME/bin:/sbin:/usr/bin:/usr/sbin
Note The general configuration is configured with the root user.
When this is configured, what is the format of the file you are looking at? Using VIM to open this file, such as vim dd.sh Open after input: set FF? He will show the format of the current file,
If it's a DOS, that's exactly the problem, he is the file under Windows, not found in the Linux environment.
Method: Continue to enter the command:: Set Ff=unix esc:wq can be.
2. View the size of the file Du-sh * View the size of files and folders under the directory.
3. Example:
#!/bin/bash
#定义变量
echo "Please input a time:for example:201609"
Read Var
#显示日期
echo "The data is deleting ..."
#连接数据库
Sqlplus-s/nolog <<eof
Set heading off feedback off pagesize 0 verify off Echo off
Conn Ybzzs/ybzzs
Delete from Security_info where maintaindate like ' $var% ';
Delete from Entry_info where maintaindate like ' $var% ';
Exit
Eof
#退出数据库
echo Delete successfully!
Echo bye!
Exit 0
4. To be continued.
Linux Shell Learning Summary