Linux Shell Learning Summary

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.