There are multiple types of Shell in Linux, the most common of which are Bourne shell (SH), c shell (CSH), and Korn shell (Ksh ). Each of the three shells has its own advantages and disadvantages. The Bourne shell is the original shell used by UNIX and can be used on every UNIX. Bourne shell is excellent in shell programming, but it is inferior to several other shells in dealing with user interactions. The default shell in Linux is the Bourne again sh
First, make sure that the file has executable permissions.# SH> chmod A + x filename
Then modify the file format# SH> VI filename
Use the following command to view the file format: Set FF or: Set fileformat
The following information is displayed:Fileformat = DoS or fileformat = Unix
Use the following command to modify the file format: Set FF = Unix or: Set fileformat = Unix
: WQ (Disk logout)
Finally,
Linux executes the. sh file, prompting no such file or directory issuesUnder the window platform, write the shell script file, migrate to the Linux platform, assign executable permissions, execute the SH file,However, no such file or directory is indicated. LS down, there is indeed the file, how can things be,Is it a file format compatibility issue? Open the Sh f
The Oracle tutorial being looked at is the sh file of the Oracle database logical backup.
SH file for full backup: exp_comp.sh
rq= ' date + '%m%d '
SU-ORACLE-C "Exp System/manager full=y inctype=complete file=/oracle/export/db_comp$rq.dmp"
SH file for cumulative backup: exp_cumu.sh
rq= ' date + '%m%d '
SU-ORACLE-C "Exp System/manager full=y inctype=cumulativ
1. sh File contents
The file name in this article is example.sh, which reads as follows:
#!/bin/bash
function Init ()
{
If [-F "Example.sql"]
Then
echo "Example.sql is exits and is deleting it,then recreate it"
Rm-fexample.sql
Else
echo "Example.sql no exits and is creating it"
Fi
echo "usezxdbp_166" >>example.sql
echo "Go" >>example.sql
}
function CreateTable ()
{
cat>>example.sql
CREATE TABLE Tb_employeeinfo
(
Employeeno varchar
Tags:. SH floating-point separators should calculate bar integer ACE SpecialUse Shell to write a simple calculator, you can implement add, subtract, multiply, divide operation, if the script name is 1.sh, execute example:./1.sh 1 + 2#!/bin/bashif[$#-ne3]thenecho "The number of parameters should be 3, for example: $01 +2 "echo" when using multiplication, you need
Public class HelloWorld {
public static void Main (string[] args) {
System.out.println ("Hello World!");
}
}
#!/bin/ksh
echo "--------helloWorld------->>"
Java_home= "/usr/jdk/jdk1.6.0_34"
Java_options= "-hotspot-xms128m-xmx512m"
Class_path=.;. /lib;
Java-jar Helloworld.jar
Note:The class that runs the main method is specified in the MANIFEST.MF in the jar package:Main-class:com.test.developersybasetestIf additional jar packages are requ
Just started learning the Linux shell language recently
It's the private dish of Brother Bird. There are two ways to execute a shell script:
1. Set execution properties: chmod 755 file
Execute (if already in current directory):./file
2. Use: Sh File execution
. But the Ubuntu 11.10 installed in VMware is not performing
#!/bin/bash
declare-i S for
((i = 1; I
Occurs when executed with the second method:
Test04_for.sh:1: Declare:not foundTes
Label: #! /bin/bash
#auto Bakcup MySQL db
Bak_dir=/data/backup/mysql/' Date +%y-%m-%d ' mysql_db=Database name MYSQL_PW=Password Mysql_usr=User name Mysqlcmd=/usr/bin/mysqldumpif[$UID-ne 0];then#must be run with the root user, $UID as a system variableEcho"This script must be executed by the root user"exit fiif[!-D $BAK _dir];then#If this directory does not existMkdir-p $BAK _dir#CreateEcho"\033[32m Create directory Success \033[0m"
ElseEcho"This directory already exists"fi $ mysqlcmd-u$mysql_us
Original article: http://blog.chinaunix.net/uid-20539088-id-115759.html
On mini2440-/bin/sh: Command: Not found SolutionI transplanted the Linux kernel and the file system according to the mini-2440 porting manual. What's different is that the cross compiler I use is the latest 4.4.1, instead of the Cross Compiler provided by tianyinao technology, when I have transplanted the yaffs file system and want to write a helloworld program to test it on the D
Shell programming is annotated with "#", but "#! /Bin/sh ", but not. "#! /Bin/sh "is the shell declaration, indicating that you are using the shell type and its path. If no declaration is made, the script will be executed in the default shell. The default shell is defined by the user's system as the shell for executing the shell script. if the script is written to run in the Korn shell ksh and the C shell C
This file must be executed before compiling the Android system. In addition to configuring the android compiling environment, you can see the text in the first few lines of its code:
Invoke ". Build/envsetup. Sh" from your shell to add the following functions to your environment:-Croot: Changes directory to the top of the tree.-M: makes from the top of the tree.-Mm: builds all of the modules in the current directory.-Mmm: builds all of the modules in
The original post of kimihong's blog isHttp://blog.csdn.net/kimihong/article/details/7523892
This file must be executed before compiling the Android system. In addition to configuring the android compiling environment, you can see the text in the first few lines of its code:
Invoke ". Build/envsetup. Sh" from your shell to add the following functions to your environment:-Croot: Changes directory to the top of the tree.-M: makes from the top of the tre
Addnode. sh failed, log file error PRKC-1025 java. lang. OutOfMemoryError: Java heap space,Environment:
Linux 5.5 + RAC 11203
Problem description:
The command to add a cluster member is as follows:
$ GRID_HOME/oui/bin/addNode. sh-silent "CLUSTER_NEW_NODES = {X3850AR}" "CLUSTER_NEW_PRIVATE_NODE_NAMES = {X3850AR-priv}" "CLUSTER_NEW_VIRTUAL_HOSTNAMES = {X3850AR-vip }"
The following error is reported:
Instanti
/U01/app/Oracle/product/11.2.0/dbhome_1/root. sh
Running Oracle 11g root. sh script...
The following environment variables are set:
ORACLE_OWNER=Oracle
ORACLE_HOME=/U01/app/oracle/product/11.2.0/dbhome_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to/usr/local/bin...
The file "oraenv" already exists in/usr/local/bin. Overwrite it? (Y/n)
[N]: y
Copying or
CentOS7 crontab is not executed. Error/bin/sh: root: command not found, centos7crontab
When you use CentOS7 to execute the scheduled script, an error is returned:
/bin/sh: root: command not found
The problem is that the file/var/spool/cron/root does not need to be written as root.
The modified script:
[root@localhost cron]# crontab -l*/10 * * * * perl /home/awstats/wwwroot/cgi-bin/awstats.pl -update -c
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.