diff --git a/bash-5.1/Cargo.toml b/bash-5.1/Cargo.toml index 87ccd3a0269ba34196c9eb01287cb92d0d552724..0c967670afade1c367ba5e87fb5f37d845513d73 100644 --- a/bash-5.1/Cargo.toml +++ b/bash-5.1/Cargo.toml @@ -65,7 +65,7 @@ members=[ ] [dependencies] - libc = "*" + libc = "0.2" rread = {path = "./builtins_rust/read"} rhistory = {path = "./builtins_rust/history"} rkill = {path = "./builtins_rust/kill"} diff --git a/bash-5.1/Makefile.in b/bash-5.1/Makefile.in index 75e657d0b40b89a5bcc47076bb4339e1117c74ed..f17ec7bc7ccdd782a69ed1e1576323af65410484 100644 --- a/bash-5.1/Makefile.in +++ b/bash-5.1/Makefile.in @@ -566,8 +566,6 @@ OTHER_DOCS = $(srcdir)/CHANGES $(srcdir)/COMPAT $(srcdir)/NEWS $(srcdir)/POSIX \ $(srcdir)/RBASH OTHER_INSTALLED_DOCS = CHANGES COMPAT NEWS POSIX RBASH README -LANGSUBDIR = resources -LANGSRC = $(srcdir)/$(LANGSUBDIR) RUST_DIR = $(top_builddir)/builtins_rust #RUST_TARGET_LIB = $(top_builddir)/target/debug/librjobs.a $(top_builddir)/target/debug/librread.a @@ -823,9 +821,6 @@ install: .made installdirs $(INSTALL_SCRIPT) $(INSTALLMODE2) rashbug $(DESTDIR)$(bindir)/rashbug -( cd $(DEFDIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) -( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) - -($(INSTALL_DATA) -D $(INSTALLMODE2) $(LANGSRC)/zh-CN/* -t $(DESTDIR)$(datadir)/utshell/${LANGSRC}/zh-CN ) - -($(INSTALL_DATA) -D $(INSTALLMODE2) $(LANGSRC)/zh-HK/* -t $(DESTDIR)$(datadir)/utshell/${LANGSRC}/zh-HK ) - -($(INSTALL_DATA) -D $(INSTALLMODE2) $(LANGSRC)/en-US/* -t $(DESTDIR)$(datadir)/utshell/${LANGSRC}/en-US ) install-strip: $(MAKE) $(MFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \ @@ -867,7 +862,6 @@ uninstall-headers: uninstall: .made $(RM) $(DESTDIR)$(bindir)/$(Program) $(DESTDIR)$(bindir)/rashbug -( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) - $(RM) -r $(DESTDIR)$(datadir)/utshell .PHONY: basic-clean clean realclean maintainer-clean distclean mostlyclean maybe-clean diff --git a/bash-5.1/builtins_rust/alias/Cargo.toml b/bash-5.1/builtins_rust/alias/Cargo.toml index a77df038a1a33ddfed9bc6875b7b4b42588eee9c..9669a4d24c97587fd3247ddf9363184d2ae6761e 100644 --- a/bash-5.1/builtins_rust/alias/Cargo.toml +++ b/bash-5.1/builtins_rust/alias/Cargo.toml @@ -10,7 +10,7 @@ name = "ralias" crate-type = ["staticlib","rlib"] [dependencies] -libc = "*" +libc = "0.2" rcmd = {path="../cmd"} rcommon= {path="../common"} -# nix = "*" +# nix = "0.23" diff --git a/bash-5.1/builtins_rust/bind/Cargo.toml b/bash-5.1/builtins_rust/bind/Cargo.toml index deb8ab73a7373247f8be1415c40231f9517f1bbd..fca9b51799b3b99849988d7419c20ab10b87f0c3 100644 --- a/bash-5.1/builtins_rust/bind/Cargo.toml +++ b/bash-5.1/builtins_rust/bind/Cargo.toml @@ -6,8 +6,8 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -libc = "*" -nix = "*" +libc = "0.2" +nix = "0.24.1" rcommon = {path = "../common"} [lib] diff --git a/bash-5.1/builtins_rust/break_1/Cargo.toml b/bash-5.1/builtins_rust/break_1/Cargo.toml index cbdf261c26fa9b3066938b47a33b3ad94edfa3eb..085d195ef9744a42dd817b5640401c107e756e1a 100644 --- a/bash-5.1/builtins_rust/break_1/Cargo.toml +++ b/bash-5.1/builtins_rust/break_1/Cargo.toml @@ -6,8 +6,8 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -libc = "*" -nix = "*" +libc = "0.2" +nix = "0.23.0" rcommon = {path="../common"} [lib] diff --git a/bash-5.1/builtins_rust/builtin/Cargo.toml b/bash-5.1/builtins_rust/builtin/Cargo.toml index 4304ddeedbaee7f115c400195bac1a5930b2d153..9301c7dcd009457302aecbbd303f57108b28af44 100644 --- a/bash-5.1/builtins_rust/builtin/Cargo.toml +++ b/bash-5.1/builtins_rust/builtin/Cargo.toml @@ -9,7 +9,7 @@ name = "rbuiltin" crate-type = ["staticlib","rlib"] [dependencies] -libc = "*" +libc = "0.2" rcmd = {path="../cmd"} rcommon = {path="../common"} diff --git a/bash-5.1/builtins_rust/caller/Cargo.toml b/bash-5.1/builtins_rust/caller/Cargo.toml index 4811682b59310cb60631ff6b304fb59fb3b48cd2..fe503dc2606224a8ce54bde544d86a1f3678b4a7 100644 --- a/bash-5.1/builtins_rust/caller/Cargo.toml +++ b/bash-5.1/builtins_rust/caller/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -libc = "*" +libc = "0.2" rread = {path="../read"} rcommon = {path="../common"} diff --git a/bash-5.1/builtins_rust/cd/Cargo.toml b/bash-5.1/builtins_rust/cd/Cargo.toml index 2d92dc876cabfc2af756ae5b00e5584b38c84052..56ccd74535501fa2928fcedfe648cd6c4844f322 100644 --- a/bash-5.1/builtins_rust/cd/Cargo.toml +++ b/bash-5.1/builtins_rust/cd/Cargo.toml @@ -7,10 +7,10 @@ build = "../build.rs" [dependencies] -lazy_static = "*" -libc = "*" +lazy_static = "1.4.0" +libc = "0.2" rcommon = {path="../common"} -nix = "*" +nix = "0.23.0" [lib] crate-type = ["staticlib","rlib"] diff --git a/bash-5.1/builtins_rust/colon/Cargo.toml b/bash-5.1/builtins_rust/colon/Cargo.toml index a6c28aa2ca663a9dd3bbd7750a8887b79e464a91..dea395cb1e76818296846d5df4879168459a2ebf 100644 --- a/bash-5.1/builtins_rust/colon/Cargo.toml +++ b/bash-5.1/builtins_rust/colon/Cargo.toml @@ -10,5 +10,5 @@ crate-type = ["staticlib","rlib"] name = "rcolon" [dependencies] -libc = "*" +libc = "0.2" rcommon = {path ="../common"} diff --git a/bash-5.1/builtins_rust/common/src/lib.rs b/bash-5.1/builtins_rust/common/src/lib.rs index 696f3bcbe3e5a857c4c702a9ba73adabddae76b6..d3387d37241036f92eb39c25ce1c5cc5387279bb 100644 --- a/bash-5.1/builtins_rust/common/src/lib.rs +++ b/bash-5.1/builtins_rust/common/src/lib.rs @@ -663,6 +663,7 @@ extern "C"{ fn builtin_help(); fn builtin_error(format:*const c_char,...); + } unsafe fn ISOPTION(s:* const c_char, c:c_char)->bool diff --git a/bash-5.1/builtins_rust/complete/Cargo.toml b/bash-5.1/builtins_rust/complete/Cargo.toml index d08f34aed9cda5335e45735d3e672f5f21db7973..58cadc61ad0fe38c3f24970e3db1b71c1547f779 100644 --- a/bash-5.1/builtins_rust/complete/Cargo.toml +++ b/bash-5.1/builtins_rust/complete/Cargo.toml @@ -7,9 +7,9 @@ edition = "2018" [dependencies] -lazy_static = "*" -libc = "*" -nix = "*" +lazy_static = "1.4.0" +libc = "0.2" +nix = "0.23.0" rcommon = {path="../common"} [lib] diff --git a/bash-5.1/builtins_rust/declare/Cargo.toml b/bash-5.1/builtins_rust/declare/Cargo.toml index f8f4e21a9e319efd758d7c10cb50741aa237a371..68cfd0b1429c69bd82cbf68b15302c9e4f8e3a35 100644 --- a/bash-5.1/builtins_rust/declare/Cargo.toml +++ b/bash-5.1/builtins_rust/declare/Cargo.toml @@ -6,9 +6,9 @@ edition = "2018" [dependencies] -lazy_static = "*" -libc = "*" -nix = "*" +lazy_static = "1.4.0" +libc = "0.2" +nix = "0.23.0" rcommon = {path = "../common"} [lib] diff --git a/bash-5.1/builtins_rust/echo/Cargo.toml b/bash-5.1/builtins_rust/echo/Cargo.toml index cbbe87e6bd083eab7b1a34b65679f181f2e13e5e..31720c0d70bb621d272e1c95ec14127a5a2409a6 100644 --- a/bash-5.1/builtins_rust/echo/Cargo.toml +++ b/bash-5.1/builtins_rust/echo/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -libc = "*" +libc = "0.2" rcommon = {path="../common"} [lib] diff --git a/bash-5.1/builtins_rust/enable/Cargo.toml b/bash-5.1/builtins_rust/enable/Cargo.toml index 14ec0946031567d4846a464dbb23992d3b32b425..99eea4b48a118a854ce5cf192719308c5ec03094 100644 --- a/bash-5.1/builtins_rust/enable/Cargo.toml +++ b/bash-5.1/builtins_rust/enable/Cargo.toml @@ -9,7 +9,7 @@ name = "renable" crate-type = ["staticlib","rlib"] [dependencies] -libc = "*" -libloading = "*" +libc = "0.2" +libloading = "0.7" rcmd = {path="../cmd"} rcommon = {path="../common"} diff --git a/bash-5.1/builtins_rust/exec/Cargo.toml b/bash-5.1/builtins_rust/exec/Cargo.toml index 47a86be61eb7d1787b77185b6856431c752d2733..605d33545c2b0138b6862251db45e62983a729e1 100644 --- a/bash-5.1/builtins_rust/exec/Cargo.toml +++ b/bash-5.1/builtins_rust/exec/Cargo.toml @@ -6,8 +6,8 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -libc = "*" -nix = "*" +libc = "0.2" +nix = "0.24.1" rcommon = {path = "../common"} [lib] diff --git a/bash-5.1/builtins_rust/exec_cmd/Cargo.toml b/bash-5.1/builtins_rust/exec_cmd/Cargo.toml index a84e76dcd39ea0ca11fb3271fe77b83c0b426696..f44bc7e663a183e069bb1968dc1db43e78633f55 100644 --- a/bash-5.1/builtins_rust/exec_cmd/Cargo.toml +++ b/bash-5.1/builtins_rust/exec_cmd/Cargo.toml @@ -50,7 +50,7 @@ rtype = {path="../type"} rulimit = {path="../ulimit"} rumask = {path="../umask"} rwait = {path="../wait"} -libc = "*" +libc = "0.2" [lib] crate-type = ["staticlib","rlib"] name = "rexec_cmd" diff --git a/bash-5.1/builtins_rust/fc/Cargo.toml b/bash-5.1/builtins_rust/fc/Cargo.toml index 5e9a0244b41277f1d96d296b3aa1ed8ab84ccfe0..70adc426c5f91082b9ff482832455a387cb88615 100644 --- a/bash-5.1/builtins_rust/fc/Cargo.toml +++ b/bash-5.1/builtins_rust/fc/Cargo.toml @@ -6,9 +6,9 @@ edition = "2018" [dependencies] -lazy_static = "*" -libc = "*" -nix = "*" +lazy_static = "1.4.0" +libc = "0.2" +nix = "0.23.0" rcommon = {path="../common"} [lib] diff --git a/bash-5.1/builtins_rust/fg_bg/Cargo.toml b/bash-5.1/builtins_rust/fg_bg/Cargo.toml index 886c7c3c15cf1aea74387ea172a75369abb08586..f054950a21edec34b603af084ca97ce030396c01 100644 --- a/bash-5.1/builtins_rust/fg_bg/Cargo.toml +++ b/bash-5.1/builtins_rust/fg_bg/Cargo.toml @@ -6,9 +6,9 @@ edition = "2018" [dependencies] -lazy_static = "*" -libc = "*" -nix = "*" +lazy_static = "1.4.0" +libc = "0.2" +nix = "0.23.0" rcommon = {path="../common"} [lib] diff --git a/bash-5.1/builtins_rust/getopts/Cargo.toml b/bash-5.1/builtins_rust/getopts/Cargo.toml index 025be6ceca2b6155434e390f566d6264c881f341..07044a6db5506a590511a5bebacd6e1607c72e6d 100644 --- a/bash-5.1/builtins_rust/getopts/Cargo.toml +++ b/bash-5.1/builtins_rust/getopts/Cargo.toml @@ -6,9 +6,9 @@ edition = "2018" [dependencies] -lazy_static = "*" -libc = "*" -nix = "*" +lazy_static = "1.4.0" +libc = "0.2" +nix = "0.23.0" rcommon = {path="../common"} [lib] diff --git a/bash-5.1/builtins_rust/help/src/lib.rs b/bash-5.1/builtins_rust/help/src/lib.rs index e4b9f7b0600c3ba5fbf879cbb027ad678b5e992b..2df677f23edfcb68a26f143b39699c834a3968c6 100644 --- a/bash-5.1/builtins_rust/help/src/lib.rs +++ b/bash-5.1/builtins_rust/help/src/lib.rs @@ -104,6 +104,7 @@ extern "C"{ #[no_mangle] pub extern "C" fn r_help_builtin(mut list:*mut WordList)->i32 { + // let mut i:i32; let mut plen:usize; let mut match_found:i32; @@ -196,10 +197,11 @@ pub extern "C" fn r_help_builtin(mut list:*mut WordList)->i32 { m = libc::strncmp (pattern, v[i], plen) == 0; } if m { + this_found = 1; match_found = match_found +1 ; if dflag == 1{ - show_desc (i as i32); + show_desc (v[i], i as i32); continue; } else if mflag ==1{ @@ -207,17 +209,30 @@ pub extern "C" fn r_help_builtin(mut list:*mut WordList)->i32 { continue; } let builtin1 = unsafe{&(*((shell_builtins as usize + (i*BUILTIN_SIZEOF!()) as usize) as *mut builtin))}; - print!("{:?}:",CStr::from_ptr(builtin1.name)); - show_helpsynopsis(i as i32); + let mgr = ResourceManager::new("./resources/{locale}/{res_id}".into()); + let resources = vec![ "message.ftl".into()]; + + let mut args = FluentArgs::new(); + let c_str: &CStr = unsafe { CStr::from_ptr(builtin1.name) }; + let msg: &str = c_str.to_str().unwrap(); + args.set("cmdName",msg); + let bundle = mgr.get_bundle(get_local_str(), resources); + let mut value = bundle.get_message("helpsynopsis").unwrap(); + let mut pattern = value.value().expect("partern err"); + let mut errors = vec![]; + let mut msg1 = bundle.format_pattern(&pattern, Some(&args), &mut errors); + println!(" {}:{}\n",msg ,msg1); if sflag == 0{ - show_longdoc(i as i32); + show_longdoc (i as i32); } } } if val == 1 && this_found == 1{ + break; } } + if (*list).next != std::ptr::null_mut(){ list = (*list).next; @@ -262,7 +277,6 @@ unsafe fn QUIT () #[no_mangle] pub extern "C" fn r_builtin_help (){ - // print all command usage let mut ind: i32 = 5; let d: i32; unsafe { @@ -305,96 +319,87 @@ fn open_helpfile(name :*mut c_char) -> i32{ fn show_longdoc(i : i32){ let builtin1 = unsafe{&(*((shell_builtins as usize + (i*BUILTIN_SIZEOF!()) as usize) as *mut builtin))}; - let mgr = ResourceManager::new("./resources/{locale}/{res_id}".into()); - let resources = vec![ "message.ftl".into()]; - let mut args = FluentArgs::new(); - let c_str: &CStr = unsafe { CStr::from_ptr(builtin1.name) }; - let s1 = String::from("command"); - match i { - 0|1|2|3|4|5 => { - args.set("cmdName",format!("{}{}",s1,i));} - 33 => { - args.set("cmdName",format!("{}{}",s1,6))} - 75 => { - args.set("cmdName",format!("{}{}",s1,7))} - _ => { - let msg: &str = c_str.to_str().unwrap(); - args.set("cmdName",msg);} - } + let mgr = ResourceManager::new("./resources/{locale}/{res_id}".into()); + let resources = vec![ "message.ftl".into()]; + let mut args = FluentArgs::new(); + let c_str: &CStr = unsafe { CStr::from_ptr(builtin1.name) }; + let msg: &str = c_str.to_str().unwrap(); + args.set("cmdName",msg); let bundle = mgr.get_bundle(get_local_str(), resources); - let mut value = bundle.get_message("helplongdoc").unwrap(); + let mut value = bundle.get_message("helpsynopsis").unwrap(); let mut pattern = value.value().expect("partern err"); let mut errors = vec![]; let mut msg1 = bundle.format_pattern(&pattern, Some(&args), &mut errors); println!(" {}", msg1); } -fn show_helpsynopsis( i : i32) -{ +fn show_desc (name : *mut c_char, i :i32){ let builtin1 = unsafe{&(*((shell_builtins as usize + (i*BUILTIN_SIZEOF!()) as usize) as *mut builtin))}; - let mgr = ResourceManager::new("/usr/share/utshell/resources/{locale}/{res_id}".into()); + let mgr = ResourceManager::new("./resources/{locale}/{res_id}".into()); let resources = vec![ "message.ftl".into()]; + let mut args = FluentArgs::new(); let c_str: &CStr = unsafe { CStr::from_ptr(builtin1.name) }; - let s1 = String::from("command"); - match i { - 0|1|2|3|4|5 => { - args.set("cmdName",format!("{}{}",s1,i));} - 33 => { - args.set("cmdName",format!("{}{}",s1,6))} - 75 => { - args.set("cmdName",format!("{}{}",s1,7))} - _ => { - let msg: &str = c_str.to_str().unwrap(); - args.set("cmdName",msg);} - } + let msg: &str = c_str.to_str().unwrap(); + args.set("cmdName",msg); let bundle = mgr.get_bundle(get_local_str(), resources); - let mut value = bundle.get_message("helpsynopsis").unwrap(); + let mut value = bundle.get_message("helpname").unwrap(); let mut pattern = value.value().expect("partern err"); let mut errors = vec![]; let mut msg1 = bundle.format_pattern(&pattern, Some(&args), &mut errors); println!(" {}", msg1); } - -fn show_desc (i :i32){ - let builtin1 = unsafe{&(*((shell_builtins as usize + (i*BUILTIN_SIZEOF!()) as usize) as *mut builtin))}; - let mgr = ResourceManager::new("/usr/share/utshell/resources/{locale}/{res_id}".into()); - let resources = vec![ "message.ftl".into()]; +fn show_manpage (name : *mut c_char, i : i32){ + + let mut j :i32; + let mut doc :*mut *mut libc::c_char; + let mut line :*mut libc::c_char = 0 as *mut libc::c_char; + let mut fd: i32; + let mut usefile : bool; + let builtin1 = unsafe{&(*((shell_builtins as usize + (i*BUILTIN_SIZEOF!()) as usize) as *mut builtin))}; + let mgr = ResourceManager::new("./resources/{locale}/{res_id}".into()); + let resources = vec![ "message.ftl".into()]; + unsafe { + doc = builtin1.long_doc; + } + //*doc = (*((shell_builtins as usize + i as usize) as *mut builtin).long_doc as *mut libc::c_char); + usefile = doc!= std::ptr::null_mut() && unsafe {*doc as *mut libc::c_char} != std::ptr::null_mut(); + usefile = usefile && unsafe {**doc as libc::c_char } == '/' as libc::c_char; + /* NAME */ + println! ("NAME\n"); let mut args = FluentArgs::new(); let c_str: &CStr = unsafe { CStr::from_ptr(builtin1.name) }; - let s1 = String::from("command"); - match i { - 0|1|2|3|4|5 => { - args.set("cmdName",format!("{}{}",s1,i));} - 33 => { - args.set("cmdName",format!("{}{}",s1,6))} - 75 => { - args.set("cmdName",format!("{}{}",s1,7))} - _ => { - let msg: &str = c_str.to_str().unwrap(); - args.set("cmdName",msg);} - } + let msg: &str = c_str.to_str().unwrap(); + args.set("cmdName",msg); let bundle = mgr.get_bundle(get_local_str(), resources); let mut value = bundle.get_message("helpname").unwrap(); let mut pattern = value.value().expect("partern err"); let mut errors = vec![]; let mut msg1 = bundle.format_pattern(&pattern, Some(&args), &mut errors); - println!(" {}", msg1); -} - -fn show_manpage (name : *mut c_char, i : i32){ - /* NAME */ - println! ("NAME\n"); - show_desc(i); + println!(" {}\n", msg1); /* SYNOPSIS */ println! ("SYNOPSIS\n"); - show_helpsynopsis(i); + value = bundle.get_message("helpsynopsis").unwrap(); + pattern = value.value().expect("partern err"); + msg1 = bundle.format_pattern(&pattern, Some(&args), &mut errors); + println!(" {}\n", msg1); + // println! (" {:?}\n", CStr::from_ptr(builtin1.short_doc)); + /* DESCRIPTION */ println! ("DESCRIPTION\n"); - show_longdoc(i); + if !usefile{ + value = bundle.get_message("helplongdoc").unwrap(); + pattern = value.value().expect("partern err"); + msg1 = bundle.format_pattern(&pattern, Some(&args), &mut errors); + println!("{}\n", msg1); + } + unsafe { + libc::putchar ('\n' as i32); + } /* SEE ALSO */ + println! ("SEE ALSO\n"); - println! (" utshell(1) {} \n\n"," "); + println! (" rash(1) {} \n\n"," "); /* IMPLEMENTATION */ println! ("IMPLEMENTATION\n"); @@ -410,6 +415,12 @@ fn show_manpage (name : *mut c_char, i : i32){ unsafe { println! ("{:?}", CStr::from_ptr(bash_license)); } + //fflush (stdout); + if usefile { + unsafe { + libc::free (line as * mut c_void); + } + } } #[no_mangle] @@ -457,7 +468,18 @@ pub extern "C" fn dispcolumn (i : i32, buf : *mut c_char, bufsize :libc::c_int, pub fn wdispcolumn (i : i32, buf :*mut c_char, bufsize : i32, width : i32, height : i32){ let mut j : i32; - show_helpsynopsis(i); + let mut dispcols : i32 = 0; + let mut dispchars : i32 = 0; + let mut helpdoc :*mut c_char; + let mut wcstr:*mut libc::wchar_t; + let mut slen : i32 = 0; + let mut n :i32 = 0; + let mut builtin1 = unsafe{&(*((shell_builtins as usize + (i*BUILTIN_SIZEOF!()) as usize) as *mut builtin))}; + helpdoc = builtin1.short_doc; + unsafe { + println! ("{:?}", CStr::from_ptr(helpdoc)); + } + } fn show_builtin_command_help (){ @@ -468,15 +490,7 @@ fn show_builtin_command_help (){ let mut t :*mut libc::c_char; let mut blurb:[libc::c_char;128] = ['0' as libc::c_char;128]; println!("help command edit by huanhuan."); - let mgr = ResourceManager::new("/usr/share/utshell/resources/{locale}/{res_id}".into()); - let resources = vec!["message.ftl".into()]; - let bundle = mgr.get_bundle(get_local_str(), resources); - let value = bundle.get_message("information").unwrap(); - let pattern = value.value().expect("partern err"); - let mut errors = vec![]; - let msg1 = bundle.format_pattern(&pattern, None, &mut errors); - println!("{}\n", msg1); - //println!("{}",("These shell commands are defined internally. Type `help' to see this list.\n Type `help name' to find out more about the function `name'.\n Use `info bash' to find out more about the shell in general.\n Use `man -k' or `info' to find out more about commands not in this list.\n A star (*) next to a name means that the command is disabled.\n")); + println!("{}",("These shell commands are defined internally. Type `help' to see this list.\n Type `help name' to find out more about the function `name'.\n Use `info bash' to find out more about the shell in general.\n Use `man -k' or `info' to find out more about commands not in this list.\n A star (*) next to a name means that the command is disabled.\n")); let ref2: &mut libc::c_char= &mut blurb[0]; @@ -490,6 +504,9 @@ fn show_builtin_command_help (){ if width <= 3{ width = 40; } + // unsafe { + // height = (num_shell_builtins + 1) / 2; /* number of rows */ + // } for i in 0..height{ unsafe { QUIT(); @@ -540,3 +557,4 @@ unsafe { // } // len // } + diff --git a/bash-5.1/builtins_rust/history/Cargo.toml b/bash-5.1/builtins_rust/history/Cargo.toml index 8bb8f51a205d33984c3c69d88ea540b82dd05b73..ac14d3d0a927bfc09553a6bf07b06c20eb68ddcc 100644 --- a/bash-5.1/builtins_rust/history/Cargo.toml +++ b/bash-5.1/builtins_rust/history/Cargo.toml @@ -12,6 +12,6 @@ name = "rhistory" crate-type = ["staticlib","rlib"] [dependencies] -libc = "*" -nix = "*" +libc = "0.2" +nix = "0.23" rcommon = {path = "../common"} diff --git a/bash-5.1/builtins_rust/kill/Cargo.toml b/bash-5.1/builtins_rust/kill/Cargo.toml index 484a3256b215325f612623436575a9e71c38e121..e28c4b8ce1fe226516ca045ba494ffc453b1f887 100644 --- a/bash-5.1/builtins_rust/kill/Cargo.toml +++ b/bash-5.1/builtins_rust/kill/Cargo.toml @@ -12,6 +12,6 @@ name = "rkill" crate-type = ["staticlib","rlib"] [dependencies] -libc = "*" -nix = "*" +libc = "0.2" +nix = "0.23" rcommon = {path = "../common"} diff --git a/bash-5.1/builtins_rust/mapfile/Cargo.toml b/bash-5.1/builtins_rust/mapfile/Cargo.toml index 6c79fbb6e19cb82d7f52f251d50c90f4ac7379bd..5d8d8f77669adb2eb9783c1290955eed901f42b4 100644 --- a/bash-5.1/builtins_rust/mapfile/Cargo.toml +++ b/bash-5.1/builtins_rust/mapfile/Cargo.toml @@ -13,6 +13,6 @@ name = "rmapfile" crate-type = ["staticlib","rlib"] [dependencies] -libc = "*" -nix = "*" +libc = "0.2" +nix = "0.23" rcommon = {path = "../common"} diff --git a/bash-5.1/builtins_rust/printf/Cargo.toml b/bash-5.1/builtins_rust/printf/Cargo.toml index 09eb47134d19e0d319fd27f87a6e8e30fcb3b16c..2ed0bdfafee90fc97a52f81d6c3a116b069e2ce9 100644 --- a/bash-5.1/builtins_rust/printf/Cargo.toml +++ b/bash-5.1/builtins_rust/printf/Cargo.toml @@ -11,6 +11,6 @@ name = "rprintf" crate-type = ["staticlib","rlib"] [dependencies] -libc = "*" -nix = "*" +libc = "0.2" +nix = "0.23" rcommon = {path = "../common"} diff --git a/bash-5.1/builtins_rust/pushd/Cargo.toml b/bash-5.1/builtins_rust/pushd/Cargo.toml index 52119df6ec14bace7ea2634f16f7e2fd44701c1f..51804e8276869208463dd1bd909ba1f634b97dda 100644 --- a/bash-5.1/builtins_rust/pushd/Cargo.toml +++ b/bash-5.1/builtins_rust/pushd/Cargo.toml @@ -6,9 +6,9 @@ edition = "2018" [dependencies] -lazy_static = "*" -libc = "*" -nix = "*" +lazy_static = "1.4.0" +libc = "0.2" +nix = "0.23.0" rcommon = {path ="../common"} [lib] diff --git a/bash-5.1/builtins_rust/read/Cargo.toml b/bash-5.1/builtins_rust/read/Cargo.toml index b13cb8c54e35abdac56d5ad70baf65b80192005f..ca0e9909841698840e002aebd7733eb99e987345 100644 --- a/bash-5.1/builtins_rust/read/Cargo.toml +++ b/bash-5.1/builtins_rust/read/Cargo.toml @@ -11,6 +11,6 @@ name = "rread" crate-type = ["staticlib", "rlib"] [dependencies] -libc = "*" -nix = "*" +libc = "0.2" +nix = "0.23" rcommon = {path = "../common"} diff --git a/bash-5.1/builtins_rust/rlet/Cargo.toml b/bash-5.1/builtins_rust/rlet/Cargo.toml index 1365a55247a938be4ff0575acb81d94fa0cf9ff3..b52101cab52d92ce7b9ddb1a90791237124ba2a3 100644 --- a/bash-5.1/builtins_rust/rlet/Cargo.toml +++ b/bash-5.1/builtins_rust/rlet/Cargo.toml @@ -12,6 +12,6 @@ name = "rlet" crate-type = ["staticlib","rlib"] [dependencies] -libc = "*" -nix = "*" -rcommon = {path = "../common"} +libc = "0.2" +nix = "0.23" +rcommon = {path = "../common"} \ No newline at end of file diff --git a/bash-5.1/builtins_rust/rreturn/Cargo.toml b/bash-5.1/builtins_rust/rreturn/Cargo.toml index 5968cac365fa37dcf5e4bf9047257fe1775923ab..6b8575a8e8694d8d8b2280914374c42f646e8b2e 100644 --- a/bash-5.1/builtins_rust/rreturn/Cargo.toml +++ b/bash-5.1/builtins_rust/rreturn/Cargo.toml @@ -12,6 +12,6 @@ name = "rreturn" crate-type = ["staticlib","rlib"] [dependencies] -libc = "*" -nix = "*" -rcommon = {path = "../common"} +libc = "0.2" +nix = "0.23" +rcommon = {path = "../common"} \ No newline at end of file diff --git a/bash-5.1/builtins_rust/set/Cargo.toml b/bash-5.1/builtins_rust/set/Cargo.toml index 33c1629de190ce1b91c86af9c83ce55f17f56e62..a437a2628cf64df7f2f97f6a8de50e845c9dc751 100644 --- a/bash-5.1/builtins_rust/set/Cargo.toml +++ b/bash-5.1/builtins_rust/set/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" [dependencies] libc="*" nix="*" -lazy_static = "*" +lazy_static = "1.4.0" rcommon = {path ="../common"} [lib] crate-type = ["staticlib","rlib"] diff --git a/bash-5.1/builtins_rust/setattr/Cargo.toml b/bash-5.1/builtins_rust/setattr/Cargo.toml index e6ca0fe5659c3a71b5d26e2b8d4c5705118d9d73..90004e4d728755daf4f9b44e5dc3c405edc7d9ad 100644 --- a/bash-5.1/builtins_rust/setattr/Cargo.toml +++ b/bash-5.1/builtins_rust/setattr/Cargo.toml @@ -15,7 +15,7 @@ crate-type = ["staticlib","rlib"] rdeclare = {path = "../declare"} [dependencies] -libc = "*" -nix = "*" +libc = "0.2" +nix = "0.23" rdeclare = {path = "../declare"} -rcommon = {path = "../common"} +rcommon = {path = "../common"} \ No newline at end of file diff --git a/bash-5.1/builtins_rust/shift/Cargo.toml b/bash-5.1/builtins_rust/shift/Cargo.toml index f9a623de147e2376fc1861004c6af34ac772d6e8..c72aedb3f71d757455401d72a53503e12c874731 100644 --- a/bash-5.1/builtins_rust/shift/Cargo.toml +++ b/bash-5.1/builtins_rust/shift/Cargo.toml @@ -12,6 +12,6 @@ name = "rshift" crate-type = ["staticlib","rlib"] [dependencies] -libc = "*" -nix = "*" +libc = "0.2" +nix = "0.23" rcommon = {path = "../common"} diff --git a/bash-5.1/builtins_rust/shopt/src/lib.rs b/bash-5.1/builtins_rust/shopt/src/lib.rs index 583437e06a5fa881eaced378e9810bdd9228d71b..5bf35b1e379d328b325a5eef606d3efb649bba2a 100644 --- a/bash-5.1/builtins_rust/shopt/src/lib.rs +++ b/bash-5.1/builtins_rust/shopt/src/lib.rs @@ -1082,7 +1082,7 @@ unsafe extern "C" fn toggle_shopts( list: *mut WordList, _quiet: i32, ) -> i32 { - // printf(CString::new(" set command: %s mode=%d").expect("").as_ptr() ,(*(*list).word).word, mode); + //printf(CString::new(" set command: %s mode=%d").expect("").as_ptr() ,(*(*list).word).word, mode); let mut l: *mut WordList; let mut ind:i32; let mut rval: i32; diff --git a/bash-5.1/builtins_rust/source/Cargo.toml b/bash-5.1/builtins_rust/source/Cargo.toml index 4c5eb608a35e465da59e6861758f8b292a39a15d..8057a26f1cf24c6ac5234872cfda8f05b185dd84 100644 --- a/bash-5.1/builtins_rust/source/Cargo.toml +++ b/bash-5.1/builtins_rust/source/Cargo.toml @@ -6,9 +6,9 @@ edition = "2018" [dependencies] -lazy_static = "*" -libc = "*" -nix = "*" +lazy_static = "1.4.0" +libc = "0.2" +nix = "0.23.0" rcommon = {path ="../common"} [lib] diff --git a/bash-5.1/builtins_rust/suspend/Cargo.toml b/bash-5.1/builtins_rust/suspend/Cargo.toml index b8ca88879f8cf99844d2143b43d29e6ccaaaaf1b..41ba9da7633cfbc8238eda01e21536c8b941aec7 100644 --- a/bash-5.1/builtins_rust/suspend/Cargo.toml +++ b/bash-5.1/builtins_rust/suspend/Cargo.toml @@ -12,6 +12,6 @@ name = "rsuspend" crate-type = ["staticlib","rlib"] [dependencies] -libc = "*" -nix = "*" +libc = "0.2" +nix = "0.23" rcommon = {path = "../common"} diff --git a/bash-5.1/builtins_rust/test/Cargo.toml b/bash-5.1/builtins_rust/test/Cargo.toml index b4162c5c51b96c49c7b9f7d38c6dd79546ebe0af..896228eeb95fe81414bd845dc12637701c8e0e8a 100644 --- a/bash-5.1/builtins_rust/test/Cargo.toml +++ b/bash-5.1/builtins_rust/test/Cargo.toml @@ -12,6 +12,6 @@ name = "rtest" crate-type = ["staticlib","rlib"] [dependencies] -libc = "*" -nix = "*" +libc = "0.2" +nix = "0.23" rcommon = {path = "../common"} diff --git a/bash-5.1/builtins_rust/times/Cargo.toml b/bash-5.1/builtins_rust/times/Cargo.toml index e9e88365913ec6c2da98f091a4bd15406a639911..3591b5ac4924e9a503ce5516493505a855f071a8 100644 --- a/bash-5.1/builtins_rust/times/Cargo.toml +++ b/bash-5.1/builtins_rust/times/Cargo.toml @@ -12,6 +12,6 @@ name = "rtimes" crate-type = ["staticlib","rlib"] [dependencies] -libc = "*" -nix = "*" +libc = "0.2" +nix = "0.23" rcommon = {path = "../common"} diff --git a/bash-5.1/builtins_rust/trap/Cargo.toml b/bash-5.1/builtins_rust/trap/Cargo.toml index 2405fb780be55fdecbb10a3d75b549255d416087..815f91ac89cf19e48667be9c90724a0177535e03 100644 --- a/bash-5.1/builtins_rust/trap/Cargo.toml +++ b/bash-5.1/builtins_rust/trap/Cargo.toml @@ -12,6 +12,6 @@ name = "rtrap" crate-type = ["staticlib","rlib"] [dependencies] -libc = "*" -nix = "*" +libc = "0.2" +nix = "0.23" rcommon = {path = "../common"} diff --git a/bash-5.1/builtins_rust/type/Cargo.toml b/bash-5.1/builtins_rust/type/Cargo.toml index 8b98ea33e5d27d8a7321244f05cf14c8108e6c3e..01ab1e935ed02420cc68410c9e3c1359a8db177c 100644 --- a/bash-5.1/builtins_rust/type/Cargo.toml +++ b/bash-5.1/builtins_rust/type/Cargo.toml @@ -1,15 +1,15 @@ [package] authors = ["zhanghuanhuan"] name = "rtype" -edition = "2018" version = "0.0.1" +edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -libc = "*" -nix = "*" +libc = "0.2" +nix = "0.23.0" rcommon = {path ="../common"} [lib] diff --git a/bash-5.1/builtins_rust/ulimit/Cargo.toml b/bash-5.1/builtins_rust/ulimit/Cargo.toml index fd642b1932b2c45d874af2297d5432a6b9bf0ea9..0e03d966d164e20d4ae41f9ada30774a16fe745d 100644 --- a/bash-5.1/builtins_rust/ulimit/Cargo.toml +++ b/bash-5.1/builtins_rust/ulimit/Cargo.toml @@ -8,9 +8,9 @@ edition = "2018" [dependencies] -lazy_static = "*" -libc = "*" -nix = "*" +lazy_static = "1.4.0" +libc = "0.2" +nix = "0.23.0" rcommon = {path = "../common"} [lib] diff --git a/bash-5.1/builtins_rust/umask/Cargo.toml b/bash-5.1/builtins_rust/umask/Cargo.toml index 6c809514a88c3d42007ca5c63b5d0bc728c5931f..882c0d870835922fc0baa17a53043786d28d3a64 100644 --- a/bash-5.1/builtins_rust/umask/Cargo.toml +++ b/bash-5.1/builtins_rust/umask/Cargo.toml @@ -10,6 +10,9 @@ edition = "2018" libc = "*" rcommon = {path = "../common"} + + + [lib] crate-type = ["staticlib","rlib"] name = "rumask" diff --git a/bash-5.1/builtins_rust/wait/Cargo.toml b/bash-5.1/builtins_rust/wait/Cargo.toml index ce4f668da1789135b7f7a575c09885f68fe3b9e1..f0dad29f5ccf3302dd27a63b08aa4558a1254a82 100644 --- a/bash-5.1/builtins_rust/wait/Cargo.toml +++ b/bash-5.1/builtins_rust/wait/Cargo.toml @@ -7,8 +7,8 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -libc = "*" -nix = "*" +libc = "0.2" +nix = "0.23.0" rjobs = {path = "../jobs"} rread = {path = "../read"} rcommon = {path = "../common"} diff --git a/bash-5.1/builtins_rust/wait/src/lib.rs b/bash-5.1/builtins_rust/wait/src/lib.rs index d48e5d7d8f6a44ab1a6401d6ae2d6e1d9c887013..6cf0626b7657b72ecaa7e6c093ecd93427ac3186 100644 --- a/bash-5.1/builtins_rust/wait/src/lib.rs +++ b/bash-5.1/builtins_rust/wait/src/lib.rs @@ -15,7 +15,7 @@ use rcommon::{r_builtin_unbind_variable,r_builtin_usage,r_get_job_spec,WordList} use rcommon::{ WordDesc, EX_USAGE, EXECUTION_SUCCESS, EXECUTION_FAILURE, EX_NOTFOUND, EX_NOEXEC, SUBSHELL_PAREN}; -// 结构体 +//结构体 #[repr(C)] pub struct procstat{ pub pid:pid_t, diff --git a/bash-5.1/configure b/bash-5.1/configure index 79ce29024eb765402cd99b22a8c77ae87e7755d8..60033ad767675212e04926c7d22de1b97909c38b 100755 --- a/bash-5.1/configure +++ b/bash-5.1/configure @@ -20510,7 +20510,7 @@ fi # this should be packaged into a script accessible via ${srcdir}/support case "$srcdir" in .) ;; -*) for d in doc tests support lib ; do # dirs +*) for d in doc tests support lib examples; do # dirs test -d $d || mkdir $d done for ld in readline glob tilde malloc sh termcap; do # libdirs diff --git a/bash-5.1/execute_cmd.c b/bash-5.1/execute_cmd.c index d1a9f1b5d217d7be3e2faf44e54866bafba1b223..4325518d75bbfc9ac604349b870632d486444c41 100644 --- a/bash-5.1/execute_cmd.c +++ b/bash-5.1/execute_cmd.c @@ -4840,7 +4840,7 @@ execute_builtin (builtin, words, flags, subshell) executing_builtin++; executing_command_builtin |= builtin == command_builtin; //result = ((*builtin) (words->next)); - result = r_exec_cmd(words->word->word, words->next); + result = r_exec_cmd(this_command_name,words->next); //r_execute_cmd2(words->next); /* This shouldn't happen, but in case `return' comes back instead of diff --git a/bash-5.1/resources/en-US/message.ftl b/bash-5.1/resources/en-US/message.ftl index 4db71531481f2848c534830968fb8a3e600cbcb4..a4a673a99b6c692973f95f5f13896b6869c7a033 100644 --- a/bash-5.1/resources/en-US/message.ftl +++ b/bash-5.1/resources/en-US/message.ftl @@ -1,87 +1,7 @@ helplongdoc ={ $cmdName -> -[command0] Resume job in foreground. - - Equivalent to the JOB_SPEC argument to the `fg' command. Resume a - stopped or background job. JOB_SPEC can specify either a job name - or a job number. Following JOB_SPEC with a `&' places the job in - the background, as if the job specification had been supplied as an - argument to `bg'. - - Exit Status: - Returns the status of the resumed job. - -[command1] Evaluate conditional expression. - - This is a synonym for the test builtin, but the last argument must - be a literal `]', to match the opening `['. -[command2] Execute commands from a file in the current shell. - - Read and execute commands from FILENAME in the current shell. The - entries in $PATH are used to find the directory containing FILENAME. - If any ARGUMENTS are supplied, they become the positional parameters - when FILENAME is executed. - - Exit Status: - Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is - not a shell builtin. - -[command3] Null command. - - No effect; the command does nothing. - - Exit Status: - Always succeeds. - -[command4] Evaluate conditional expression. - - This is a synonym for the test builtin, but the last argument must - be a literal `]', to match the opening `['. - -[command5] Execute conditional command. - - Returns a status of 0 or 1 depending on the evaluation of the - conditional - expression EXPRESSION. Expressions are composed of the same primaries - used - by the `test' builtin, and may be combined using the following - operators: - - ( EXPRESSION ) Returns the value of EXPRESSION - ! EXPRESSION True if EXPRESSION is false; else false - EXPR1 && EXPR2 True if both EXPR1 and EXPR2 are true; else false - EXPR1 || EXPR2 True if either EXPR1 or EXPR2 is true; else false - - When the `==' and `!=' operators are used, the string to the right of - the operator is used as a pattern and pattern matching is performed. - When the `=~' operator is used, the string to the right of the operator - is matched as a regular expression. - - The && and || operators do not evaluate EXPR2 if EXPR1 is sufficient to - -[command6] Arithmetic for loop. - - Equivalent to - (( EXP1 )) - while (( EXP2 )); do - COMMANDS - (( EXP3 )) - done - EXP1, EXP2, and EXP3 are arithmetic expressions. If any expression is - omitted, it behaves as if it evaluates to 1. - - Exit Status: - Returns the status of the last command executed. - -[command7] Group commands as a unit. - - Run a set of commands in a group. This is one way to redirect an - entire set of commands. - - Exit Status: - Returns the status of the last command executed. - -[set] Set or unset values of shell options and positional parameters. + [set] + Set or unset values of shell options and positional parameters. Change the value of shell attributes and positional parameters, or display tmes and values of shell variables. @@ -727,26 +647,26 @@ $cmdName -> grouped into levels of equal-precedence operators. The levels are listed in order of decreasing precedence. - \tid++, id--\tvariable post-increment, post-decrement - \t++id, --id\tvariable pre-increment, pre-decrement - \t-, +\t\tunary minus, plus - \t!, ~\t\tlogical and bitwise negation - \t**\t\texponentiation - \t*, /, %\t\tmultiplication, division, remainder - \t+, -\t\taddition, subtraction - \t<<, >>\t\tleft and right bitwise shifts - \t<=, >=, <, >\tcomparison - \t==, !=\t\tequality, inequality - \t&\t\tbitwise AND - \t^\t\tbitwise XOR - \t|\t\tbitwise OR - \t&&\t\tlogical AND - \t||\t\tlogical OR - \texpr ? expr : expr - \t\t\tconditional operator - \t=, *=, /=, %=, - \t+=, -=, <<=, >>=, - \t&=, ^=, |=\tassignment + id++, id-- variable post-increment, post-decrement + ++id, --id variable pre-increment, pre-decrement + -, + unary minus, plus + !, ~ logical and bitwise negation + ** exponentiation + *, /, % multiplication, division, remainder + +, - addition, subtraction + <<, >> left and right bitwise shifts + <=, >=, <, > comparison + ==, != equality, inequality + & bitwise AND + ^ bitwise XOR + | bitwise OR + && logical AND + || logical OR + expr ? expr : expr + conditional operator + =, *=, /=, %=, + +=, -=, <<=, >>=, + &=, ^=, |= assignment Shell variables are allowed as operands. The name of the variable is replaced by its value (coerced to a fixed-width integer) within @@ -1448,8 +1368,8 @@ $cmdName -> function. -r keyseq Remove the binding for KEYSEQ. -f filename Read key bindings from FILENAME. - -x keyseq:shell-command Cause SHELL-COMMAND to be executed when - KEYSEQ is entered. + -x keyseq:shell-command\tCause SHELL-COMMAND to be executed when + \t\t\t\tKEYSEQ is entered. -X List key sequences bound with -x and associated commands in a form that can be reused as input. @@ -1498,59 +1418,11 @@ $cmdName -> Exit Status: If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise. - - [declare] Set variable values and attributes. - - Declare variables and give them attributes. If no NAMEs are given, - display the attributes and values of all variables. - - Options: - -f\trestrict action or display to function names and definitions - -F\trestrict display to function names only (plus line number and - \t\tsource file when debugging) - -g\tcreate global variables when used in a shell function; otherwise - \t\tignored - -I\tif creating a local variable, inherit the attributes and value - \t\tof a variable with the same name at a previous scope - -p\tdisplay the attributes and value of each NAME - - Options which set attributes: - -a\tto make NAMEs indexed arrays (if supported) - -A\tto make NAMEs associative arrays (if supported) - -i\tto make NAMEs have the `integer' attribute - -l\tto convert the value of each NAME to lower case on assignment - -n\tmake NAME a reference to the variable named by its value - -r to make NAMEs readonly - -t to make NAMEs have the `trace' attribute - -u to convert the value of each NAME to upper case on assignment - -x to make NAMEs export - - Using `+' instead of `-' turns off the given attribute. - - Variables with the integer attribute have arithmetic evaluation (see - the `let' command) performed when the variable is assigned a value. - - When used in a function, `declare' makes NAMEs local, as with the -`local' - command. The `-g' option suppresses this behavior. - - Exit Status: - Returns success unless an invalid option is supplied or a variable - assignment error occurs. - *[other] show other command help info. } helpname = { $cmdName -> -[command0] {" % - Resume job in foreground."} -[command1] {"(( - Evaluate conditional expression. "} -[command2] {". - Execute commands from a file in the current shell. "} -[command3] {": - Null command."} -[command4] {"[ - Evaluate conditional expression."} -[command5] {"[[ - Execute conditional command. "} -[command6] {"for (( - Arithmetic for loop."} -[command7] Group commands as a unit. [set] set - Set or unset values of shell options and positional parameters. [read] read - Read a line from the standard input and split it into fields. [type] type - Display information about command type. @@ -1618,93 +1490,77 @@ $cmdName -> [source] source - Execute commands from a file in the current shell. [bind] bind - Set Readline key bindings and variables.。 [test] test - Evaluate arithmetic expressions. -[declare] declare - Set variable values and attributes. *[other] show other command help info.. } helpsynopsis = { $cmdName -> -[command0] {"job_spec [&]"} -[command1] {"(( expression ))"} -[command2] {". filename [arguments]"} -[command3] {":"} -[command4] {"[ ... ]"} -[command5] {"[[ expression ]]"} -[command6] {"for (( exp1; exp2; exp33 )); do COMMANDS ; done"} -[command7] {"{ COMMAND ; }"} -[set] {set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]} -[read] {read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]} -[type] {type [-afptP] name [name ...]} -[trap] {trap [-lp] [[arg] signal_spec ...]} -[alias] {alias [-p] [name[=value] ... ]} -[unalias] {unalias [-a] name [name ...]} -[break] {break [n]} -[continue] {continue [n]} -[builtin] {unalias [-a] name [name ...]} -[caller] {caller [expr] } -[cd] {cd [-L|[-P [-e]] [-@]] [dir]} -[pwd] {pwd [-LP]} -[true] {true} -[shopt] {shopt [-pqsu] [-o] [optname ...]} -[false] {false} -[command] {command [-pVv] command [arg ...]} -[echo] {echo [-neE] [arg ...]} -[enable] {enable [-a] [-dnps] [-f filename] [name ...] } -[getopts] {getopts optstring name [arg ...]} -[exec] {exec [-cl] [-a name] [command [argument ...]] [redirection ...] } -[exit] {exit [n]} -[logout] {logout [n]} -[fc] {fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]} -[fg] {fg [job_spec] } -[bg] {bg [job_spec ...]} -[hash] {hash [-lr] [-p pathname] [-dt] [name ...]} -[help] {help [-dms] [pattren ...]} -[history] {history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]} -[jobs] {jobs [-lnprs] [jobspec ...] or jobs -x command [args]} -[disown] {disown [-h] [-ar] [jobspec ... | pid ...]} -[kill] {kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]} -[let] {let arg [arg ...]} -[shift] {shift [n]} -[suspend] {suspend [-f]} -[eval] {eval [arg ...]} -[times] {times} -[ulimit] {ulimit [-SHabcdefiklmnpqrstuvxPT] [ulimit]} -[umask] {umask [-p] [-S] [pattern]} -[return] {return [n]} -[wait] {wait [-fn] [-p var] [id ...]} -[for] {for NAME [in WORDS ... ] ; do COMMANDS; done} -[select] {select NAME [in WORDS ... ;] do COMMANDS; done} -[time] {time [-p] pipeline} -[case] {case WORD in [pattern [| pattern]...) COMMANDS ;;]... esac} -[if] {if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] fi} -[while] {while COMMANDS; do COMMANDS; done} -[until] {until COMMANDS; do COMMANDS; done} -[coproc] {coproc [NAME] COMMANDS [redirections]} -[variables] {variables - variables - Names and meanings of some shell variables} -[pushd] {pushd [-n] [+N | -N | dir]} -[popd] {popd [-n] [+N | -N]} -[dirs] {dirs [-clpv] [+N] [-N]} -[printf] {printf [-v var] format [arguments]} -[complete] {complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...]} -[compgen] {compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]} -[compopt] {compopt [-o|+o option] [-DEI] [name ...]} -[mapfile] {mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]]} -[unset] {unset [-f] [-v] [-n] [NAME ...]} -[readarray] {readarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]} -[local] {local [option] name[=value] ... } -[export] {export [-fn] [name[=value] ...] or export -p} -[readonly] {readonly [-aAf] [name[=value] ...] or readonly -p} -[function] {function NAME { COMMANDS ; } 或 name () { COMMANDS ; } } -[typeset] {typeset [-aAfFgiIlnrtux] [-p] name[=value] ...} -[source] {source filename [arguments]} -[bind] {bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:shell-command] [keyseq:readline-function or readline-command] } -[test] {test [expr]} -[declare] {declare [-aAfFgilnrtux] [-p] [name[=value] ...]} +[set] {"set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]"} +[read] {"read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]"} +[type] {"type [-afptP] name [name ...]"} +[trap] {"trap [-lp] [[arg] signal_spec ...]"} +[alias] {"alias [-p] [name[=value] ... ]"} +[unalias] {"unalias [-a] name [name ...]"} +[break] {"break [n]"} +[continue] {"continue [n]"} +[builtin] {"unalias [-a] name [name ...]"} +[caller] {"caller [expr] "} +[cd] {"cd [-L|[-P [-e]] [-@]] [dir]"} +[pwd] {"pwd [-LP]"} +[true] {"true"} +[shopt] {"shopt [-pqsu] [-o] [optname ...]"} +[false] {"false"} +[command] {"command [-pVv] command [arg ...]"} +[echo] {"echo [-neE] [arg ...]"} +[enable] {"enable [-a] [-dnps] [-f filename] [name ...] "} +[getopts] {"getopts optstring name [arg ...]"} +[exec] {"exec [-cl] [-a name] [command [argument ...]] [redirection ...] "} +[exit] {"exit [n]"} +[logout] {"logout [n]"} +[fc] {"fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]"} +[fg] {"fg [job_spec] "} +[bg] {"bg [job_spec ...]"} +[hash] {"hash [-lr] [-p pathname] [-dt] [name ...]"} +[help] {"help [-dms] [pattren ...]"} +[history] {"history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]"} +[jobs] {"jobs [-lnprs] [jobspec ...] or jobs -x command [args]"} +[disown] {"disown [-h] [-ar] [jobspec ... | pid ...]"} +[kill] {"kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]"} +[let] {"let arg [arg ...]"} +[shift] {"shift [n]"} +[suspend] {"suspend [-f]"} +[eval] {"eval [arg ...]"} +[times] {"times"} +[ulimit] {"ulimit [-SHabcdefiklmnpqrstuvxPT] [ulimit]"} +[umask] {"umask [-p] [-S] [pattern]"} +[return] {"return [n]"} +[wait] {"wait [-fn] [-p var] [id ...]"} +[for] {"for NAME [in WORDS ... ] ; do COMMANDS; done"} +[select] {"select NAME [in WORDS ... ;] do COMMANDS; done"} +[time] {"time [-p] pipeline"} +[case] {"case WORD in [pattern [| pattern]...) COMMANDS ;;]... esac"} +[if] {"if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] fi"} +[while] {"while COMMANDS; do COMMANDS; done"} +[until] {"until COMMANDS; do COMMANDS; done"} +[coproc] {"coproc [NAME] COMMANDS [redirections]"} +[variables] {"variables - variables - Names and meanings of some shell variables"} +[pushd] {"pushd [-n] [+N | -N | dir]"} +[popd] {"popd [-n] [+N | -N]"} +[dirs] {"dirs [-clpv] [+N] [-N]"} +[printf] {"printf [-v var] format [arguments]"} +[complete] {"complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...]"} +[compgen] {"compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]"} +[compopt] {"compopt [-o|+o option] [-DEI] [name ...]"} +[mapfile] {"mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]]"} +[unset] {"unset [-f] [-v] [-n] [NAME ...]"} +[readarray] {"readarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]"} +[local] {"local [option] name[=value] ... "} +[export] {"export [-fn] [name[=value] ...] or export -p"} +[readonly] {"readonly [-aAf] [name[=value] ...] or readonly -p"} +[function] {"function NAME { COMMANDS ; } 或 name () { COMMANDS ; } "} +[typeset] {"typeset [-aAfFgiIlnrtux] [-p] name[=value] ..."} +[source] {"source filename [arguments]"} +[bind] {"bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:shell-command] [keyseq:readline-function or readline-command] "} +[test] {"test [expr]"} *[other] show other command help info.. } - -information = These shell commands are defined internally. Type `help' to see this list. - Type `help name' to find out more about the function `name'. - Use `info bash' to find out more about the shell in general. - Use `man -k' or `info' to find out more about commands not in this list. - A star (*) next to a name means that the command is disabled. \ No newline at end of file diff --git a/bash-5.1/resources/zh-CN/message.ftl b/bash-5.1/resources/zh-CN/message.ftl index 790553947059db45e0ed58b6b803a110e5367919..f7e1faf2d325797e88b1c1ed019f4792c2651c56 100644 --- a/bash-5.1/resources/zh-CN/message.ftl +++ b/bash-5.1/resources/zh-CN/message.ftl @@ -1,81 +1,5 @@ helplongdoc ={ $cmdName -> -[command0] 在前台继续任务 - 对于 JOB_SPEC 参数来说和 `fg' 命令等同。继续一个 - 停止的或者后台任务。JOB_SPEC 可以指定一个任务 - 名字或任务号。在 JOB_SPEC 后加上一个 `&' 将会把 - 任务放至后台,就像任务声明被作为 `bg' 命令的参数 - 执行一样。 - - 退出状态: - 返回被继续的任务的状态。 - -[command1] 估值条件表达式。 - 是内建命令 test 的同义词,但是最后一个参数必须是 - 字符 `]',以匹配起始的 `['。 - -[command2] 在当前 shell 中执行一个文件中的命令。 - - 在当前 shell 中读取并执行 FILENAME 文件中的命令。$PATH 变量中的 - 条目被用于寻找包含 FILENAME 文件的目录。如果提供了任何的 ARGUMENTS - 参数,则它们将成为 FILENAME 文件执行时的位置参数。 - - 退出状态: - 返回 FILENAME 文件中最后一个命令的状态;如果 FILENAME 文件不可读则失败。 - -[command3] 空的命令。 - 没有效果; 此命令不做任何操作。 - - 退出状态: - 总是成功。 - -[command4] 估值条件表达式。 - - 是内建命令 test 的同义词,但是最后一个参数必须是 - 字符 `]',以匹配起始的 `['。 - -[command5] 执行条件命令。 - - 根据条件表达式 EXPRESSION 的估值返回状态0或1。表达式按照 - `test' 内建的相同条件组成,或者可以有下列操作符连接而成: - - ( EXPRESSION ) 返回 EXPRESSION 表达式的值 - ! EXPRESSION 如果 EXPRESSION表达式为假则为真,否则为假 - EXPR1 && EXPR2 如果 EXPR1 和 EXPR2 表达式均为真则为真,否则为假 - EXPR1 || EXPR2 如果 EXPR1 和 EXPR2 表达式中有一个为真则为真,否则为 - 假 - - 当使用 `==' 和 `!=' 操作符时,操作符右边的字符串被用作模式并且执行一个 - 匹配。当使用 `=~' 操作符时,操作符右边的字符串被当作正则表达式来进行 - 匹配。 - - 操作符 && 和 || 将不对 EXPR2 表达式进行估值,如果 EXPR1 表达式足够确定 - 整个表达式的值。 - - 退出状态: - 根据 EXPRESSION 的值为0或1。 - -[command6] 算术 for 循环。 - - 等价于 - (( EXP1 )) - while (( EXP2 )); do - 命令们 - (( EXP3 )) - done - EXP1、EXP2 和 EXP3 都是算术表达式。如果省略任何表达式, - 则等同于使用了估值为1的表达式。 - - 退出状态: - 返回最后执行的命令的状态。 -[command7] 将命令组合为一个单元。 - - 运行组中的命令集合。这是对整个命令集合 - 做重定向的方法之一。 - - 退出状态: - 返回最后一个执行的命令的状态。 - [set] 设定或取消设定 shell 选项和位置参数的 @@ -167,26 +91,26 @@ $cmdName -> 如果没有提供 NAME 变量,则读取的行被存放在 REPLY 变量中。 选项: - -a array 将词语赋值给 ARRAY 数组变量的序列下标成员,从零开始 - -d delim 持续读取直到读入 DELIM 变量中的第一个字符,而不是换行符 - -e 使用 Readline 获取行 - -i text 使用 TEXT 文本作为 Readline 的初始文字 - -n nchars 读取 nchars 个字符之后返回,而不是等到读取换行符。 - 但是分隔符仍然有效,如果遇到分隔符之前读取了不足 nchars 个字符。 - -N nchars 在准确读取了 nchars 个字符之后返回,除非遇到文件结束符或者读 + -a array\t将词语赋值给 ARRAY 数组变量的序列下标成员,从零开始 + -d delim\t持续读取直到读入 DELIM 变量中的第一个字符,而不是换行符 + -e\t使用 Readline 获取行 + -i text\t使用 TEXT 文本作为 Readline 的初始文字 + -n nchars\t读取 nchars 个字符之后返回,而不是等到读取换行符。 + \t\t但是分隔符仍然有效,如果遇到分隔符之前读取了不足 nchars 个字符。 + -N nchars\t在准确读取了 nchars 个字符之后返回,除非遇到文件结束符或者读 超时, - 任何的分隔符都被忽略 - -p prompt 在尝试读取之前输出 PROMPT 提示符并且不带 - 换行符 - -r 不允许反斜杠转义任何字符 - -s 不回显终端的任何输入 - -t timeout 如果在 TIMEOUT 秒内没有读取一个完整的行则超时并且返回失 + \t\t任何的分隔符都被忽略 + -p prompt\t在尝试读取之前输出 PROMPT 提示符并且不带 + \t\t换行符 + -r\t不允许反斜杠转义任何字符 + -s\t不回显终端的任何输入 + -t timeout\t如果在 TIMEOUT 秒内没有读取一个完整的行则超时并且返回失 败。 - TMOUT 变量的值是默认的超时时间。TIMEOUT 可以是小数。 - 如果 TIMEOUT 是 0,那么仅当在指定的文件描述符上输入有效的时候, - read 才返回成功;否则它将立刻返回而不尝试读取任何数据。 - 如果超过了超时时间,则返回状态码大于 128 - -u fd 从文件描述符 FD 中读取,而不是标准输入 + \t\tTMOUT 变量的值是默认的超时时间。TIMEOUT 可以是小数。 + \t\t如果 TIMEOUT 是 0,那么仅当在指定的文件描述符上输入有效的时候, + \t\tread 才返回成功;否则它将立刻返回而不尝试读取任何数据。 + \t\t如果超过了超时时间,则返回状态码大于 128 + -u fd\t从文件描述符 FD 中读取,而不是标准输入 退出状态: 返回码为零,除非遇到了文件结束符、读超时(且返回码不大于128)、 @@ -197,20 +121,20 @@ $cmdName -> 对于每一个 NAME 名称,指示如果作为命令它将如何被解释。 选项: - -a 显示所有包含名称为 NAME 的可执行文件的位置; - 包括别名、内建和函数。仅当 `-p' 选项没有使用时 - -f 抑制 shell 函数查询 - -P 为每个 NAME 名称惊醒 PATH 路径搜索,即使它是别名、 - 内建或函数,并且返回将被执行的磁盘上文件的名称。 - -p 返回将被执行的磁盘上文件的名称,或者当 `type -t NAME' - 不返回 `file' 时,不返回任何值。 - -t 返回下列词中的任何一个 `alias'、`keyword'、 - `function'、`builtin'、`file' 或者 `',相应地如果 NAME 是 - 一个别名、shell 保留字、shell 函数、shell 内建、 - 磁盘文件或没有找到。 + -a\t显示所有包含名称为 NAME 的可执行文件的位置; + \t\t包括别名、内建和函数。仅当 `-p' 选项没有使用时 + -f\t抑制 shell 函数查询 + -P\t为每个 NAME 名称惊醒 PATH 路径搜索,即使它是别名、 + \t\t内建或函数,并且返回将被执行的磁盘上文件的名称。 + -p\t返回将被执行的磁盘上文件的名称,或者当 `type -t NAME' + \t不返回 `file' 时,不返回任何值。 + -t\t返回下列词中的任何一个 `alias'、`keyword'、 + \t`function'、`builtin'、`file' 或者 `',相应地如果 NAME 是 + \t一个别名、shell 保留字、shell 函数、shell 内建、 + \t磁盘文件或没有找到。 参数: - NAME 将要解析的命令。 + NAME\t将要解析的命令。 退出状态: 返回成功,除非使用了无效的选项或者 NAME 名称为只读。 @@ -233,8 +157,8 @@ $cmdName -> 如果不提供参数,trap 打印列表显示每一个与每一个信号相关联的命令。 选项: - -l 打印一个信号名称和它们对应的编号的列表 - -p 打印与每个 SIGNAL_SPEC 信号相关联的陷阱命令 + -l\t打印一个信号名称和它们对应的编号的列表 + -p\t打印与每个 SIGNAL_SPEC 信号相关联的陷阱命令 每一个 SIGNAL_SPEC 信号可以是 中的信号名称或者信号编号。 信号名称大小写敏感且可以使用 SIG 前缀。信号可用 \kill -信号 $$\ @@ -251,7 +175,7 @@ $cmdName -> 值末尾的空格会使下一个词被检测作为别名替换展开。 选项: - -p 以可重用的格式打印所有的已定义的别名 + -p\t以可重用的格式打印所有的已定义的别名 退出状态: 除非一个没有定义的名字被作为参数提供,否则 alias @@ -260,7 +184,7 @@ $cmdName -> [unalias] 从别名定义列表中删除每一个“名字”。 选项: - -a 删除所有的别名定义 + -a\t删除所有的别名定义 返回成功,除非“名字”不是一个已存在的别名。 @@ -319,12 +243,12 @@ $cmdName -> 变量名。如果该变量有值,则它的值被当作 DIR 目录。 选项: - -L 强制跟随符号链接: 在处理 `..' 之后解析 DIR 中的符号链接。 - -P 使用物理目录结构而不跟随符号链接: 在处理 `..' 之前解析 DIR 中的符 + -L\t强制跟随符号链接: 在处理 `..' 之后解析 DIR 中的符号链接。 + -P\t使用物理目录结构而不跟随符号链接: 在处理 `..' 之前解析 DIR 中的符 号链接。 - -e 如果使用了 -P 参数,但不能成功确定当前工作目录时,返回非零的返回 + -e\t如果使用了 -P 参数,但不能成功确定当前工作目录时,返回非零的返回 值。 - -@ 在支持拓展属性的系统上,将一个有这些属性的文件当作有文件属性的目 + -@\t在支持拓展属性的系统上,将一个有这些属性的文件当作有文件属性的目 录。 默认情况下跟随符号链接,如同指定 `-L'。 @@ -336,8 +260,8 @@ $cmdName -> [pwd]打印当前工作目录的名字。 选项: - -L 打印 $PWD 变量的值,如果它包含了当前的工作目录 - -P 打印当前的物理路径,不带有任何的符号链接 + -L\t打印 $PWD 变量的值,如果它包含了当前的工作目录 + -P\t打印当前的物理路径,不带有任何的符号链接 默认情况下,`pwd' 的行为和带 `-L' 选项一致 @@ -357,11 +281,11 @@ $cmdName -> 同时标注每一个选项是否被设定。 选项: - -o 限制 OPTNAME 为定义用于`set -o' 的选项 - -p 打印每个 shell 选项并标注它的状态。 - -q 抑制输出 - -s 启用(设定)每个 OPTNAME 选项 - -u 禁用(取消设定)每个 OPTNAME 选项 + -o\t限制 OPTNAME 为定义用于`set -o' 的选项 + -p\t打印每个 shell 选项并标注它的状态。 + -q\t抑制输出 + -s\t启用(设定)每个 OPTNAME 选项 + -u\t禁用(取消设定)每个 OPTNAME 选项 退出状态: 如果 OPTNAME 选项被启用则返回成功;如果是 @@ -379,9 +303,9 @@ $cmdName -> 情况下用于启动磁盘上的命令。 选项: - -p 使用 PATH 变量的一个默认值以确保所有的标准工具都能被找到。 - -v 打印 COMMAND 命令的描述,和 `type' 内建相似 - -V 打印每个 COMMAND 命令的详细描述 + -p\t使用 PATH 变量的一个默认值以确保所有的标准工具都能被找到。 + -v\t打印 COMMAND 命令的描述,和 `type' 内建相似 + -V\t打印每个 COMMAND 命令的详细描述 退出状态 返回 COMMAND 命令的返回状态,或者当找不到 COMMAND 命令时失败。 @@ -391,29 +315,29 @@ $cmdName -> 在标准输出上,显示用空格分割的 ARG 参数后跟一个换行。 选项: - -n 不要追加换行 - -e 启用下列反斜杠转义的解释 - -E 显式地抑制对于反斜杠转义的解释 + -n\t不要追加换行 + -e\t启用下列反斜杠转义的解释 + -E\t显式地抑制对于反斜杠转义的解释 `echo' 对下列反斜杠字符进行转义: - \a 警告(响铃) - \\b 退格 - \\c 抑制更多的输出 - \\e 转义字符 - \\f 换页字符 + \a\t警告(响铃) + \\b\t退格 + \\c\t抑制更多的输出 + \\e\t转义字符 + \\f\t换页字符 \\t换行 \\r\t回车 \\t\t横向制表符 \\v\t纵向制表符 \\\\\t反斜杠 - \\0nnn 以 NNN(八进制)为 ASCII 码的字符。NNN 可以是 0 到 3 个八进制 + \\0nnn\t以 NNN(八进制)为 ASCII 码的字符。NNN 可以是 0 到 3 个八进制 位 - \\xHH 以 HH(十六进制)为值的八比特字符。HH 可以是一个或两个十六进制 + \\xHH\t以 HH(十六进制)为值的八比特字符。HH 可以是一个或两个十六进制 位 - \\uHHHH 以 HHHH(十六进制)为值的 Unicode 字符。HHHH 可以是一个到 - 四个十六进制位。 + \\uHHHH\t以 HHHH(十六进制)为值的 Unicode 字符。HHHH 可以是一个到 + \t\t四个十六进制位。 \\UHHHHHHHH 以 HHHHHHHH(十六进制)为值的 Unicode 字符。 - HHHHHHHH 可以是一到八个十六进制位。 + \t\tHHHHHHHH 可以是一到八个十六进制位。 退出状态: 返回成功除非有写错误发生。 @@ -423,7 +347,7 @@ $cmdName -> 在标准输出设备上显示 ARGs 参数和一个换行。 选项: - -n 不附加换行 + -n\t不附加换行 退出状态: 除非写错误发生,否则返回成功。 @@ -435,14 +359,14 @@ $cmdName -> 选项: - -a 打印一个内建的列表,并显示其中每一个是否启用 - -n 禁用每一个 NAME 内建或者显示一个被禁用的内建的列表 - -p 以可重用的格式打印一个内建的列表 - -s 仅打印Posix `special' 内建的名称 + -a\t打印一个内建的列表,并显示其中每一个是否启用 + -n\t禁用每一个 NAME 内建或者显示一个被禁用的内建的列表 + -p\t以可重用的格式打印一个内建的列表 + -s\t仅打印Posix `special' 内建的名称 控制动态加载的选项: - -f 从共享对象 FILENAME 文件中加载 NAME 内建 - -d 删除以 -f 选项加载的内建 + -f\t从共享对象 FILENAME 文件中加载 NAME 内建 + -d\t删除以 -f 选项加载的内建 不带选项时,每一个 NAME 内建都被启用。 @@ -497,9 +421,9 @@ $cmdName -> 没有指定COMMAND 命令,则任何的重定向在当前 shell 中生效。 选项: - -a 名称 作为第0个参数传递给 COMMAND 命令 - -c 在一个空环境中执行 COMMAND 命令 - -l 在COMMAND 命令的第0个参数中加一个短线 + -a 名称\t作为第0个参数传递给 COMMAND 命令 + -c\t\t在一个空环境中执行 COMMAND 命令 + -l\t\t在COMMAND 命令的第0个参数中加一个短线 如果命令不能被执行,则退出一个非交互式的 shell,除非 shell 选项`execfail' 已经设定。 @@ -525,11 +449,11 @@ $cmdName -> 选项: - -e ENAME 选择使用哪个编辑器。默认的是 FCEDIT, 然后是 EDITOR, - 然后是 vi - -l 列出行而不编辑 - -n 列举时省略行号 - -r 反转行的顺序(最新行在前) + -e ENAME\t选择使用哪个编辑器。默认的是 FCEDIT, 然后是 EDITOR, + \t\t然后是 vi + -l \t列出行而不编辑 + -n\t列举时省略行号 + -r\t反转行的顺序(最新行在前) 用 `fc -s [模式=替换 ...] [命令]' 的格式,COMMAND 命令会在 OLD=NEW 替换之后被重新执行。 @@ -565,15 +489,15 @@ $cmdName -> 如果不提供参数,则显示已经记住的命令的信息。 选项: - -d 忘记每一个已经记住的 NAME 的位置 - -l 以可作为输入重用的格式显示 - -p pathname 使用 pathname 路径作为 NAME 命令的全路径 - -r 忘记所有记住的位置 - -t 打印记住的每一个 NAME 名称的位置,如果指定了多个 - NAME 名称,则每个位置前面会加上相应的 NAME 名称 - + -d\t\t忘记每一个已经记住的 NAME 的位置 + -l\t\t以可作为输入重用的格式显示 + -p pathname\t使用 pathname 路径作为 NAME 命令的全路径 + -r\t\t忘记所有记住的位置 + -t\t\t打印记住的每一个 NAME 名称的位置,如果指定了多个 + \t\tNAME 名称,则每个位置前面会加上相应的 NAME 名称 + \t\t 参数: - NAME 每个 NAME 名称会在 $PATH 路径变量中被搜索,并且添加到记住的命 + NAME\t\t每个 NAME 名称会在 $PATH 路径变量中被搜索,并且添加到记住的命 令 列表中。 @@ -587,13 +511,13 @@ $cmdName -> 印一个帮助主题列表 选项: - -d 输出每个主题的简短描述 - -m 以伪 man 手册的格式显示使用方法 - -s 为每一个匹配 PATTERN 模式的主题仅显示一个用法 - 简介 + -d\t输出每个主题的简短描述 + -m\t以伪 man 手册的格式显示使用方法 + -s\t为每一个匹配 PATTERN 模式的主题仅显示一个用法 + \t简介 参数: - PATTERN 指定帮助主题的模式 + PATTERN\t指定帮助主题的模式 退出状态: 返回成功,除非未找到 PATTERN 模式没有找到或者使用了无效选项。 @@ -604,18 +528,18 @@ $cmdName -> 参数 N 会仅列出最后的 N 个条目。 选项: - -c 删除所有条目从而清空历史列表。 - -d 偏移量 从指定位置删除历史列表。负偏移量将从历史条目末尾 - 开始计数 + -c\t删除所有条目从而清空历史列表。 + -d 偏移量\t从指定位置删除历史列表。负偏移量将从历史条目末尾 + \t\t开始计数 - -a 将当前会话的历史行追加到历史文件中 - -n 从历史文件中读取所有未被读取的行 - 并且将它们附加到历史列表 - -r 读取历史文件并将内容追加到历史列表中 - -w 将当前历史写入到历史文件中 + -a\t将当前会话的历史行追加到历史文件中 + -n\t从历史文件中读取所有未被读取的行 + \t\t并且将它们附加到历史列表 + -r\t读取历史文件并将内容追加到历史列表中 + -w\t将当前历史写入到历史文件中 - -p 对每一个 ARG 参数展开历史并显示结果,而不存储到历史列表中 - -s 以单条记录追加 ARG 到历史列表中 + -p\t对每一个 ARG 参数展开历史并显示结果,而不存储到历史列表中 + -s\t以单条记录追加 ARG 到历史列表中 如果给定了 FILENAME 文件名,则它将被作为历史文件。否则 如果 $HISTFILE 变量有值的话使用之,不然使用 ~/.bash_history 文件。 @@ -632,11 +556,11 @@ $cmdName -> 不带选项时,所有活动任务的状态都会显示。 选项: - -l 在正常信息基础上列出进程号 - -n 仅列出上次通告之后改变了状态的进程 - -p 仅列出进程号 - -r 限制仅输出运行中的任务 - -s 限制仅输出停止的任务 + -l\t在正常信息基础上列出进程号 + -n\t仅列出上次通告之后改变了状态的进程 + -p\t仅列出进程号 + -r\t限制仅输出运行中的任务 + -s\t限制仅输出停止的任务 如果使用了 -x 选项,ARG 参数中的所有任务声明会被替换为该任务 的进程组头领的进程号,然后执行 COMMAND 命令。 @@ -651,10 +575,10 @@ $cmdName -> JOBSPEC 参数时,shell 使用观念中的当前任务。 选项: - -a 如果不提供 JOBSPEC 参数,则删除所有任务 - -h 标识每个 JOBSPEC 任务,从而当 shell 接收到 SIGHUP - 信号时不发送 SIGHUP 给指定任务 - -r 仅删除运行中的任务 + -a\t如果不提供 JOBSPEC 参数,则删除所有任务 + -h\t标识每个 JOBSPEC 任务,从而当 shell 接收到 SIGHUP + \t\t信号时不发送 SIGHUP 给指定任务 + -r\t仅删除运行中的任务 退出状态: 返回成功除非使用了无效的选项或者 JOBSPEC 声明。 @@ -666,17 +590,16 @@ $cmdName -> SIGSPEC 或 SIGNUM,那么假定发送 SIGTERM 信号。 选项: - -s sig SIG 是信号名称 - -n sig SIG 是信号编号 - -l 列出信号名称;如果参数后跟 `-l'则被假设为信号编号, - 而相应的信号名称会被列出 + -s sig\tSIG 是信号名称 + -n sig\tSIG 是信号编号 + -l\t列出信号名称;如果参数后跟 `-l'则被假设为信号编号, + \t\t而相应的信号名称会被列出 Kill 成为 shell 内建有两个理由:它允许使用任务编号而不是进程号, 并且在可以创建的进程数上限达到是允许进程被杀死。 退出状态: 返回成功,除非使用了无效的选项或者有错误发生。 - [let] 估值算术表达式。 将每个 ARG 参赛作为算术表达式来估值。估值的计算以定宽的整 @@ -727,7 +650,7 @@ $cmdName -> 登录 shell 不可以被挂起,除非强制执行。 选项: - -f 强制挂起,即使是登录 shell。 + -f\t强制挂起,即使是登录 shell。 退出状态: 返回成功,除非没有启用任务控制或者有错误发生。 @@ -818,29 +741,29 @@ $cmdName -> 资源的控制。 选项: - -S 使用软 (`soft') 资源限制 - -H 使用硬 (`hard') 资源限制 - -a 所有当前限制都被报告 - -b 套接字缓存尺寸 - -c 创建的核文件的最大尺寸 - -d 一个进程的数据区的最大尺寸 - -e 最高的调度优先级 (`nice') - -f 有 shell 及其子进程可以写的最大文件尺寸 - -i 最多的可以挂起的信号数 - -k 分配给此进程的最大 kqueue 数量 - -l 一个进程可以锁定的最大内存尺寸 - -m 最大的内存进驻尺寸 - -n 最多的打开的文件描述符个数 - -p 管道缓冲区尺寸 - -q POSIX 信息队列的最大字节数 - -r 实时调度的最大优先级 - -s 最大栈尺寸 - -t 最大的CPU时间,以秒为单位 - -u 最大用户进程数 - -v 虚拟内存尺寸 - -x 最大的文件锁数量 - -P 最大伪终端数量 - -T 最大线程数量 + -S\t使用软 (`soft') 资源限制 + -H\t使用硬 (`hard') 资源限制 + -a\t所有当前限制都被报告 + -b\t套接字缓存尺寸 + -c\t创建的核文件的最大尺寸 + -d\t一个进程的数据区的最大尺寸 + -e\t最高的调度优先级 (`nice') + -f\t有 shell 及其子进程可以写的最大文件尺寸 + -i\t最多的可以挂起的信号数 + -k\t分配给此进程的最大 kqueue 数量 + -l\t一个进程可以锁定的最大内存尺寸 + -m\t最大的内存进驻尺寸 + -n\t最多的打开的文件描述符个数 + -p\t管道缓冲区尺寸 + -q\tPOSIX 信息队列的最大字节数 + -r\t实时调度的最大优先级 + -s\t最大栈尺寸 + -t\t最大的CPU时间,以秒为单位 + -u\t最大用户进程数 + -v\t虚拟内存尺寸 + -x\t最大的文件锁数量 + -P\t最大伪终端数量 + -T\t最大线程数量 并非所有选项在所有系统上可用。 @@ -863,8 +786,8 @@ $cmdName -> chmod(1) 可接收的符号模式串。 选项: - -p 如果省略 MODE 模式,以可重用为输入的格式输入 - -S 以符号形式输出,否则以八进制数格式输出 + -p\t如果省略 MODE 模式,以可重用为输入的格式输入 + -S\t以符号形式输出,否则以八进制数格式输出 退出状态: 返回成功,除非使用了无效的 MODE 模式或者选项。 @@ -920,7 +843,7 @@ $cmdName -> CPU 时间的总结。 选项: - -p 用可迁移的 POSIX 格式打印用时总结。 + -p\t用可迁移的 POSIX 格式打印用时总结。 TIMEFORMAT 变量的值被作为输出格式。 @@ -974,45 +897,45 @@ $cmdName -> [variables] 常用 shell 变量名称和使用。 - BASH_VERSION 当前 Bash 的版本信息。 - CDPATH 用于 `cd' 命令参数搜索的分号分隔的目录列表 - GLOBIGNORE 路径扩展时忽略的文件名匹配模式列表, - 以分号分隔。 - HISTFILE 您的命令历史存放的文件名称。 - HISTFILESIZE 历史文件最多可以保存的行数。 - HISTSIZE 一个运行的 shell 最多可以访问的历史命令行数。 - HOME 您的登录目录的完整路径。 - HOSTNAME 当前主机的主机名。 - HOSTTYPE 当前版本的 BASH 在其之上运行的 CPU 类型。 - IGNOREEOF 控制 shell 收到文件结束符作为单一输入后的 - 动作。如果设定这个变量,则它的值是 shell 退出之前在 - 一个空行上可以连续看到的文件结束符数量(默认为10)。 - 未设定时,文件结束符标志着输入的结束。 - MACHTYPE 描述当前运行 Bash 的系统的字符串。 - MAILCHECK Bash 检测新邮件的频率,以秒为单位。 - MAILPATH Bash 从中检测新邮件的文件列表,以分号分隔。 - OSTYPE 运行 Bash 的 Unix 版本。 - PATH 当寻找命令时搜索的目录列表,以冒号分隔。 - PROMPT_COMMAND 打印每一个主提示符之前执行的命 - 令。 - PS1 主提示符字符串。 - PS2 从提示符字符串。 - PWD 当前目录的完整路径。 - SHELLOPTS 已启用的 shell 选项列表,以冒号分隔。 - TERM 当前终端类型的名称。 - TIMEFORMAT 以关键则 `time' 显示的时间统计信息的输出 - 格式。 - auto_resume 非空时,一个单独的命令词会首先被在当前 - 停止的任务列表中搜索。如果找到则该任务被置于前台。 - 如果值为 `exact' 则意味着命令词必须精确匹配停止任务 - 列表中的命令。如果值为 `substring' 则意味着命令词必 - 须匹配任务的一个子字符串。任何其他的值意味着命令词 - 必须是停止任务的一个前缀。 - histchars 控制历史展开和快速替换的字符。第一个字符是 - 历史替换字符,通常是 `!'。第二个字符是快速替换字符, - 通常是 `^'。第三个是历史注释字符,通常是 `#'。 - HISTIGNORE 用于决定哪些命令被存入历史文件的模式 - 列表,以冒号分隔。 + BASH_VERSION\t当前 Bash 的版本信息。 + CDPATH\t用于 `cd' 命令参数搜索的分号分隔的目录列表 + GLOBIGNORE\t路径扩展时忽略的文件名匹配模式列表, + \t\t以分号分隔。 + HISTFILE\t您的命令历史存放的文件名称。 + HISTFILESIZE\t历史文件最多可以保存的行数。 + HISTSIZE\t一个运行的 shell 最多可以访问的历史命令行数。 + HOME\t您的登录目录的完整路径。 + HOSTNAME\t当前主机的主机名。 + HOSTTYPE\t当前版本的 BASH 在其之上运行的 CPU 类型。 + IGNOREEOF\t控制 shell 收到文件结束符作为单一输入后的 + \t\t动作。如果设定这个变量,则它的值是 shell 退出之前在 + \t\t一个空行上可以连续看到的文件结束符数量(默认为10)。 + \t\t未设定时,文件结束符标志着输入的结束。 + MACHTYPE\t描述当前运行 Bash 的系统的字符串。 + MAILCHECK\tBash 检测新邮件的频率,以秒为单位。 + MAILPATH\tBash 从中检测新邮件的文件列表,以分号分隔。 + OSTYPE\t运行 Bash 的 Unix 版本。 + PATH\t当寻找命令时搜索的目录列表,以冒号分隔。 + PROMPT_COMMAND\t打印每一个主提示符之前执行的命 + \t\t令。 + PS1\t\t主提示符字符串。 + PS2\t\t从提示符字符串。 + PWD\t\t当前目录的完整路径。 + SHELLOPTS\t已启用的 shell 选项列表,以冒号分隔。 + TERM\t当前终端类型的名称。 + TIMEFORMAT\t以关键则 `time' 显示的时间统计信息的输出 + \t\t格式。 + auto_resume\t非空时,一个单独的命令词会首先被在当前 + \t\t停止的任务列表中搜索。如果找到则该任务被置于前台。 + \t\t如果值为 `exact' 则意味着命令词必须精确匹配停止任务 + \t\t列表中的命令。如果值为 `substring' 则意味着命令词必 + \t\t须匹配任务的一个子字符串。任何其他的值意味着命令词 + \t\t必须是停止任务的一个前缀。 + histchars\t控制历史展开和快速替换的字符。第一个字符是 + \t\t历史替换字符,通常是 `!'。第二个字符是快速替换字符, + \t\t通常是 `^'。第三个是历史注释字符,通常是 `#'。 + HISTIGNORE\t用于决定哪些命令被存入历史文件的模式 + \t\t列表,以冒号分隔。 [pushd] 将目录添加到栈中。 @@ -1020,17 +943,17 @@ $cmdName -> 新的栈顶。不带参数时,交换栈顶的两个目录。 选项: - -n 抑制添加目录至栈时通常的改变目录操作,从而仅对栈 - 进行操作。 + -n\t抑制添加目录至栈时通常的改变目录操作,从而仅对栈 + \t进行操作。 参数: - +N 旋转栈从而第 N 个目录 (`dirs' 显示的列表中左起,从零开始) - 将移动到栈顶。 + +N\t旋转栈从而第 N 个目录 (`dirs' 显示的列表中左起,从零开始) + \t将移动到栈顶。 - -N 旋转栈从而第 N 个目录 (`dirs' 显示的列表中右起,从零开始) - 将移动到栈顶。 + -N\t旋转栈从而第 N 个目录 (`dirs' 显示的列表中右起,从零开始) + \t将移动到栈顶。 - dir 将 DIR 目录添加到栈顶,并且使其成为当前工作目录。 + dir\t将 DIR 目录添加到栈顶,并且使其成为当前工作目录。 `dirs' 内建显示目录栈。 @@ -1042,15 +965,15 @@ $cmdName -> 顶目录。 选项: - -n 抑制从栈中删除目录时通常的目录变换操作,从而仅对栈 - 进行操作。 + -n\t抑制从栈中删除目录时通常的目录变换操作,从而仅对栈 + \t进行操作。 参数: - +N 删除第 N 个目录 (`dirs' 显示的目录列表中左起,从零开始)。 - 例如:`popd +0' 删除第一个目录,`popd +1' 删除第二个。 + +N\t删除第 N 个目录 (`dirs' 显示的目录列表中左起,从零开始)。 + \t例如:`popd +0' 删除第一个目录,`popd +1' 删除第二个。 - -N 删除第 N 个目录 (`dirs' 显示的目录列表中右起,从零开始)。 - 例如:`popd -0' 删除最后一个目录,,`popd -1' 删除倒数第二个。 + -N\t删除第 N 个目录 (`dirs' 显示的目录列表中右起,从零开始)。 + \t例如:`popd -0' 删除最后一个目录,,`popd -1' 删除倒数第二个。 `dirs' 内建显示目录栈。 @@ -1063,17 +986,17 @@ $cmdName -> 中;`popd' 命令可用于遍历弹出列表。 选项: - -c 删除所有元素以清空目录栈 - -l 不打印与主目录相关的波浪号前缀的目录 - -p 每行一个条目打印目录栈 - -v 每行一个条目,以栈中位置为前缀打印目录栈 + -c\t删除所有元素以清空目录栈 + -l\t不打印与主目录相关的波浪号前缀的目录 + -p\t每行一个条目打印目录栈 + -v\t每行一个条目,以栈中位置为前缀打印目录栈 参数: - +N 显示 dirs 不带选项启动时显示的目录列表左起中第 - N 个目录,从零开始。 + +N\t显示 dirs 不带选项启动时显示的目录列表左起中第 + \tN 个目录,从零开始。 - -N 显示 dirs 不带选项启动时显示的目录列表右起中第 - N 个目录,从零开始。 + -N\t显示 dirs 不带选项启动时显示的目录列表右起中第 + \tN 个目录,从零开始。 退出状态: 返回成功,除非使用了无效的选项或者发生错误。 @@ -1081,7 +1004,7 @@ $cmdName -> [printf] 在 FORMAT 的控制下格式化并打印 ARGUMENTS 参数。 选项: - -v var 将输出赋值给 shell 变量 VAR 而不显示在标准输出上 + -v var\t将输出赋值给 shell 变量 VAR 而不显示在标准输出上 FORMAT 是包含三种对象的字符串:简单地被拷贝到标准输出的普通字符; 被变换之后拷贝到标准输入的转义字符;以及每个都会影响到下个参数的打印的格 @@ -1089,9 +1012,9 @@ $cmdName -> 在 printf(1) 中描述的标准控制声明之外,printf 解析: - %b 扩展对应参数中的反斜杠转义序列 - %q 以可作为 shell 输入的格式引用参数 - %(fmt)T 以 FMT 为供给 strftime(3) 的格式输出日期时间字符串 + %b\t扩展对应参数中的反斜杠转义序列 + %q\t以可作为 shell 输入的格式引用参数 + %(fmt)T\t以 FMT 为供给 strftime(3) 的格式输出日期时间字符串 退出状态: 返回成功,除非使用了无效的选项或者写或赋值错误发生。 @@ -1102,12 +1025,12 @@ $cmdName -> 现有的补全声明会以可以重用为输入的格式打印出来。 选项: - -p 以可重用的格式打印现有的补全声明。 - -r 对于每个 NAME 名称删除补全声明,或者如果没有提供 NAME - 名称,删除所有的补全声明。 - -D 对于没有补全声明定义的命令,设定默认的补全动作 - -E 对于 \empty\ 命令设定补全动作,—— 对于空行的补全。 - -I 将补全和动作应用在首单词(通常是所给命令)上 + -p\t以可重用的格式打印现有的补全声明。 + -r\t对于每个 NAME 名称删除补全声明,或者如果没有提供 NAME + \t名称,删除所有的补全声明。 + -D\t对于没有补全声明定义的命令,设定默认的补全动作 + -E\t对于 \empty\ 命令设定补全动作,—— 对于空行的补全。 + -I\t将补全和动作应用在首单词(通常是所给命令)上 尝试补全时,按照上述大写字母选项的顺序进行动作。 如果给出了多个选项,-D 选项优先级高于 -E 选项,且 @@ -1132,10 +1055,10 @@ $cmdName -> 如果不带选项,打印每个 NAME 名称的补全选项或当前的补全声明。 选项: - -o option 为每个 NAME 名称设定补全选项 option - -D 为 \default\ 命令补全改变选项 - -E 为 \empty\ 命令补全改变选项 - -I 为首单词的补全改变选项 + \t-o option\t为每个 NAME 名称设定补全选项 option + \t-D\t\t为 \default\ 命令补全改变选项 + \t-E\t\t为 \empty\ 命令补全改变选项 + \t-I\t\t为首单词的补全改变选项 使用 `+o' 而不是 `-o' 可以关闭指定的选项。 @@ -1155,17 +1078,17 @@ $cmdName -> 从文件描述符 FD 中读取。MAPFILE 变量是默认的 ARRAY 变量。 选项: - -d delim 使用 DELIM 而非换行符断行 - -n count 最多拷贝 COUNT 行,如果 COUNT 为 0,则拷贝所有行。 - -O origin 从下标 ORIGIN 开始 赋值给 ARRAY 变量。默认下标是0. - -s count 丢弃最先读取的 COUNT 行。 - -t 从读取的每行末尾删除一个换行符。 - -u fd 从文件描述符 FD 中读取行而不是标准输入。 - -C callback 每 QUANTUM 次读行之后对 CALLBACK 回调进行估值。 - -c quantum 定义每次调用 CALLBACK 回调之间读取的行数。 + -d delim\t使用 DELIM 而非换行符断行 + -n count\t最多拷贝 COUNT 行,如果 COUNT 为 0,则拷贝所有行。 + -O origin\t从下标 ORIGIN 开始 赋值给 ARRAY 变量。默认下标是0. + -s count \t丢弃最先读取的 COUNT 行。 + -t\t\t从读取的每行末尾删除一个换行符。 + -u fd\t\t从文件描述符 FD 中读取行而不是标准输入。 + -C callback\t每 QUANTUM 次读行之后对 CALLBACK 回调进行估值。 + -c quantum\t定义每次调用 CALLBACK 回调之间读取的行数。 参数: - ARRAY 存储数据使用的数组变量 + ARRAY\t\t存储数据使用的数组变量 如果使用了 -C 而没有 -c,默认的量子是5000。当对 CALLBACK 估值时, 下一个将被赋值的数组元素的下标作为额外参数被传递。 @@ -1182,9 +1105,9 @@ $cmdName -> 对每一个 NAME 名称,删除对应的变量或函数。 选项: - -f 将每个 NAME 视为函数 - -v 将每个 NAME 视为变量 - -n 将每个 NAME 视为名称引用,只取消其本身而非其指向的变量 + -f\t将每个 NAME 视为函数 + -v\t将每个 NAME 视为变量 + -n\t将每个 NAME 视为名称引用,只取消其本身而非其指向的变量 不带选项时,unset 首先尝试取消设定一个变量,如果失败,再尝试取消设定一个 函数。 @@ -1247,38 +1170,6 @@ $cmdName -> 退出状态: 返回成功,除非使用了无效的选项或者 NAME 名称。 - [declare] 设定变量值和属性。 - - 声明变量并且赋予它们属性。如果没有给定名称, - 则显示所有变量的属性和值。 - - 选项: - -f 限制动作或显示为仅函数名称和定义 - -F 限制仅显示函数名称 (以及调试时显示行号和源文件名) - -g 当用于 shell 函数内时创建全局变量; 否则忽略 - -p 显示每个 NAME 变量的属性和值 - - 设定属性的选项: - -a 使 NAME 成为下标数组 (如果支持) - -A 使 NAME 成为关联数组 (如果支持) - -i 使 NAME 带有 `integer' (整数)属性 - -l 将 NAME 在赋值时转为小写 - -n 使 NAME 成为指向一个以其值为名称的变量的引用 - -r 将 NAME 变为只读 - -t 使 NAME 带有 `trace' (追踪)属性 - -u 将每个 NAME 在赋值时转为大写 - -x 将 NAME 导出 - - 用 `+' 代替 `-' 会关闭指定选项。 - - 带有整数属性的变量在赋值时将使用算术估值(见 - `let' 命令) - - 在函数中使用时,`declare' 使 NAME 成为本地变量,和 `local' - 命令一致。`-g' 选项抑制此行为。 - - 退出状态: - 返回成功,除非提供了无效选项或者发生变量赋值错误 [function] 定义 shell 函数。 @@ -1290,6 +1181,7 @@ $cmdName -> 退出状态: 返回成功除非 NAME 为只读。 + [typeset] 设置变量的值和属性。 `declare' 的等价形式。参见 `help declare'。 @@ -1377,14 +1269,6 @@ $cmdName -> helpname = { $cmdName -> -[command0] {" % - 在前台继续任务"} -[command1] {"(( - 估值条件表达式。"} -[command2] {". 文件名 [参数]"} -[command3] {":"} -[command4] {"[ 参数... ]"} -[command5] {"[[ 表达式 ]]"} -[command6] {"for (( - 算术 for 循环。"} -[command7] 将命令组合为一个单元。 [set] set - 设定或取消设定 shell 选项和位置参数的 [read] read - 从标准输入读取一行并将其分为不同的域。 [type] type - 显示命令类型的信息。 @@ -1452,20 +1336,13 @@ $cmdName -> [source] source - 在当前 shell 中执行一个文件中的命令。 [bind] bind - 设定 Readline 键绑定和变量。 [test] test - 估值算术表达式。 -[declare] declare - 设置变量的值和属性。 *[other] 显示其他命令帮助信息 . + + } helpsynopsis = { $cmdName -> -[command0] {"job_spec [&]"} -[command1] {"(( - "} -[command2] {". - 在当前 shell 中执行一个文件中的命令。"} -[command3] {": - 空的命令。"} -[command4] {"[ - 估值条件表达式。"} -[command5] {"[[ ... ]] - 执行条件命令。"} -[command6] {"for (( 表达式1; 表达式2; 表达式3 )); do 命令 ; done"} -[command7] {"{ 命令 ; }"} [set] {"set [--abefhkmnptuvxBCHP][-o 选项名][--][参数 ...]"} [read] {"read [-ers] [-a 数组] [-d 分隔符] [-i 缓冲区文字] [-n 读取字符数] [-N 读取字符数] [-p 提示符] [-t 超时] [-u 文件描述符] [名称 ...]"} [type] {"type [-afptP] 名称 [名称 ...]"} @@ -1519,7 +1396,7 @@ $cmdName -> [popd] {"popd [-n] [+N | -N]"} [dirs] {"dirs [-clpv] [+N] [-N]"} [printf] {"printf [-v var] 格式 [参数]"} -[complete] {"complete [-abcdefgjksuv] [-pr] [-DEI] [-o 选项] [-A 动作] [-G 全局模式] [-W 词语列表] [-F 函数] [-C 命令] [-X 过滤模式] [-P 前缀] [-S 后缀] [名称 ...]"} +[complete] {"complete [-abcdefgjksuv] [-pr] [-DEI] [-o 选项] [-A 动作] [-G 全局模式][-W 词语列表] [-F 函数] [-C 命令] [-X 过滤模式] [-P 前缀] [-S 后缀] [名称 ...]"} [compgen] {"compgen [-abcdefgjksuv] [-o 选项] [-A 动作] [-G 全局模式] [-W 词语列表] [-F 函数] [-C 命令] [-X 过滤模式] [-P 前缀] [-S 后缀] [词语]"} [compopt] {"compopt [-o|+o 选项] [-DEI] [名称 ...]"} [mapfile] {"mapfile [-d 分隔符] [-n 计数] [-O 起始序号] [-s 计数] [-t] [-u fd] [-C 回调] [-c 量子] [数组]"} @@ -1531,13 +1408,7 @@ $cmdName -> [function] {"function 名称 { 命令 ; } 或 name () { 命令 ; } "} [typeset] {"typeset [-aAfFgilnrtux] [-p] 名称[=值] ..."} [source] {"source 文件名 [参数]"} -[bind] {"bind [-lpvsPSVX] [-m 键映射] [-f 文件名] [-q 名称] [-u 名称] [-r 键序列] [-x 键序列:shell-命令] [键序列:readline-函数 或 readline-命令] "} +[bind] {"bind [-lpvsPSVX] [-m 键映射] [-f 文件名] [-q 名称] [-u 名称] [-r 键序列] [-x 键序列:shell-命令] [键序列:readline-函数 或 readline-命令] "} [test] {"test [表达式]"} -[declare] {"declare [-aAfFgilnrtux] [-p] [名称[=值] ...]"} -*[other] 显示其他命令帮助信息 . +*[other] 显示其他命令帮助信息 } - -information = 这些 shell 命令是内部定义的。请输入 `help' 以获取一个列表。 - 输入 `help 名称' 以得到有关函数`名称'的更多信息。 - 使用 `info bash' 来获得关于 shell 的更多一般性信息。 - 使用 `man -k' 或 `info' 来获取不在列表中的命令的更多信息。 \ No newline at end of file diff --git a/bash-5.1/resources/zh-HK/message.ftl b/bash-5.1/resources/zh-HK/message.ftl index 790553947059db45e0ed58b6b803a110e5367919..6e07aed1f5ba302b5cc79e2c1f7a4a1d66c880f0 100644 --- a/bash-5.1/resources/zh-HK/message.ftl +++ b/bash-5.1/resources/zh-HK/message.ftl @@ -1,81 +1,5 @@ helplongdoc ={ $cmdName -> -[command0] 在前台继续任务 - 对于 JOB_SPEC 参数来说和 `fg' 命令等同。继续一个 - 停止的或者后台任务。JOB_SPEC 可以指定一个任务 - 名字或任务号。在 JOB_SPEC 后加上一个 `&' 将会把 - 任务放至后台,就像任务声明被作为 `bg' 命令的参数 - 执行一样。 - - 退出状态: - 返回被继续的任务的状态。 - -[command1] 估值条件表达式。 - 是内建命令 test 的同义词,但是最后一个参数必须是 - 字符 `]',以匹配起始的 `['。 - -[command2] 在当前 shell 中执行一个文件中的命令。 - - 在当前 shell 中读取并执行 FILENAME 文件中的命令。$PATH 变量中的 - 条目被用于寻找包含 FILENAME 文件的目录。如果提供了任何的 ARGUMENTS - 参数,则它们将成为 FILENAME 文件执行时的位置参数。 - - 退出状态: - 返回 FILENAME 文件中最后一个命令的状态;如果 FILENAME 文件不可读则失败。 - -[command3] 空的命令。 - 没有效果; 此命令不做任何操作。 - - 退出状态: - 总是成功。 - -[command4] 估值条件表达式。 - - 是内建命令 test 的同义词,但是最后一个参数必须是 - 字符 `]',以匹配起始的 `['。 - -[command5] 执行条件命令。 - - 根据条件表达式 EXPRESSION 的估值返回状态0或1。表达式按照 - `test' 内建的相同条件组成,或者可以有下列操作符连接而成: - - ( EXPRESSION ) 返回 EXPRESSION 表达式的值 - ! EXPRESSION 如果 EXPRESSION表达式为假则为真,否则为假 - EXPR1 && EXPR2 如果 EXPR1 和 EXPR2 表达式均为真则为真,否则为假 - EXPR1 || EXPR2 如果 EXPR1 和 EXPR2 表达式中有一个为真则为真,否则为 - 假 - - 当使用 `==' 和 `!=' 操作符时,操作符右边的字符串被用作模式并且执行一个 - 匹配。当使用 `=~' 操作符时,操作符右边的字符串被当作正则表达式来进行 - 匹配。 - - 操作符 && 和 || 将不对 EXPR2 表达式进行估值,如果 EXPR1 表达式足够确定 - 整个表达式的值。 - - 退出状态: - 根据 EXPRESSION 的值为0或1。 - -[command6] 算术 for 循环。 - - 等价于 - (( EXP1 )) - while (( EXP2 )); do - 命令们 - (( EXP3 )) - done - EXP1、EXP2 和 EXP3 都是算术表达式。如果省略任何表达式, - 则等同于使用了估值为1的表达式。 - - 退出状态: - 返回最后执行的命令的状态。 -[command7] 将命令组合为一个单元。 - - 运行组中的命令集合。这是对整个命令集合 - 做重定向的方法之一。 - - 退出状态: - 返回最后一个执行的命令的状态。 - [set] 设定或取消设定 shell 选项和位置参数的 @@ -167,26 +91,26 @@ $cmdName -> 如果没有提供 NAME 变量,则读取的行被存放在 REPLY 变量中。 选项: - -a array 将词语赋值给 ARRAY 数组变量的序列下标成员,从零开始 - -d delim 持续读取直到读入 DELIM 变量中的第一个字符,而不是换行符 - -e 使用 Readline 获取行 - -i text 使用 TEXT 文本作为 Readline 的初始文字 - -n nchars 读取 nchars 个字符之后返回,而不是等到读取换行符。 - 但是分隔符仍然有效,如果遇到分隔符之前读取了不足 nchars 个字符。 - -N nchars 在准确读取了 nchars 个字符之后返回,除非遇到文件结束符或者读 + -a array\t将词语赋值给 ARRAY 数组变量的序列下标成员,从零开始 + -d delim\t持续读取直到读入 DELIM 变量中的第一个字符,而不是换行符 + -e\t使用 Readline 获取行 + -i text\t使用 TEXT 文本作为 Readline 的初始文字 + -n nchars\t读取 nchars 个字符之后返回,而不是等到读取换行符。 + \t\t但是分隔符仍然有效,如果遇到分隔符之前读取了不足 nchars 个字符。 + -N nchars\t在准确读取了 nchars 个字符之后返回,除非遇到文件结束符或者读 超时, - 任何的分隔符都被忽略 - -p prompt 在尝试读取之前输出 PROMPT 提示符并且不带 - 换行符 - -r 不允许反斜杠转义任何字符 - -s 不回显终端的任何输入 - -t timeout 如果在 TIMEOUT 秒内没有读取一个完整的行则超时并且返回失 + \t\t任何的分隔符都被忽略 + -p prompt\t在尝试读取之前输出 PROMPT 提示符并且不带 + \t\t换行符 + -r\t不允许反斜杠转义任何字符 + -s\t不回显终端的任何输入 + -t timeout\t如果在 TIMEOUT 秒内没有读取一个完整的行则超时并且返回失 败。 - TMOUT 变量的值是默认的超时时间。TIMEOUT 可以是小数。 - 如果 TIMEOUT 是 0,那么仅当在指定的文件描述符上输入有效的时候, - read 才返回成功;否则它将立刻返回而不尝试读取任何数据。 - 如果超过了超时时间,则返回状态码大于 128 - -u fd 从文件描述符 FD 中读取,而不是标准输入 + \t\tTMOUT 变量的值是默认的超时时间。TIMEOUT 可以是小数。 + \t\t如果 TIMEOUT 是 0,那么仅当在指定的文件描述符上输入有效的时候, + \t\tread 才返回成功;否则它将立刻返回而不尝试读取任何数据。 + \t\t如果超过了超时时间,则返回状态码大于 128 + -u fd\t从文件描述符 FD 中读取,而不是标准输入 退出状态: 返回码为零,除非遇到了文件结束符、读超时(且返回码不大于128)、 @@ -197,20 +121,20 @@ $cmdName -> 对于每一个 NAME 名称,指示如果作为命令它将如何被解释。 选项: - -a 显示所有包含名称为 NAME 的可执行文件的位置; - 包括别名、内建和函数。仅当 `-p' 选项没有使用时 - -f 抑制 shell 函数查询 - -P 为每个 NAME 名称惊醒 PATH 路径搜索,即使它是别名、 - 内建或函数,并且返回将被执行的磁盘上文件的名称。 - -p 返回将被执行的磁盘上文件的名称,或者当 `type -t NAME' - 不返回 `file' 时,不返回任何值。 - -t 返回下列词中的任何一个 `alias'、`keyword'、 - `function'、`builtin'、`file' 或者 `',相应地如果 NAME 是 - 一个别名、shell 保留字、shell 函数、shell 内建、 - 磁盘文件或没有找到。 + -a\t显示所有包含名称为 NAME 的可执行文件的位置; + \t\t包括别名、内建和函数。仅当 `-p' 选项没有使用时 + -f\t抑制 shell 函数查询 + -P\t为每个 NAME 名称惊醒 PATH 路径搜索,即使它是别名、 + \t\t内建或函数,并且返回将被执行的磁盘上文件的名称。 + -p\t返回将被执行的磁盘上文件的名称,或者当 `type -t NAME' + \t不返回 `file' 时,不返回任何值。 + -t\t返回下列词中的任何一个 `alias'、`keyword'、 + \t`function'、`builtin'、`file' 或者 `',相应地如果 NAME 是 + \t一个别名、shell 保留字、shell 函数、shell 内建、 + \t磁盘文件或没有找到。 参数: - NAME 将要解析的命令。 + NAME\t将要解析的命令。 退出状态: 返回成功,除非使用了无效的选项或者 NAME 名称为只读。 @@ -233,8 +157,8 @@ $cmdName -> 如果不提供参数,trap 打印列表显示每一个与每一个信号相关联的命令。 选项: - -l 打印一个信号名称和它们对应的编号的列表 - -p 打印与每个 SIGNAL_SPEC 信号相关联的陷阱命令 + -l\t打印一个信号名称和它们对应的编号的列表 + -p\t打印与每个 SIGNAL_SPEC 信号相关联的陷阱命令 每一个 SIGNAL_SPEC 信号可以是 中的信号名称或者信号编号。 信号名称大小写敏感且可以使用 SIG 前缀。信号可用 \kill -信号 $$\ @@ -251,7 +175,7 @@ $cmdName -> 值末尾的空格会使下一个词被检测作为别名替换展开。 选项: - -p 以可重用的格式打印所有的已定义的别名 + -p\t以可重用的格式打印所有的已定义的别名 退出状态: 除非一个没有定义的名字被作为参数提供,否则 alias @@ -260,7 +184,7 @@ $cmdName -> [unalias] 从别名定义列表中删除每一个“名字”。 选项: - -a 删除所有的别名定义 + -a\t删除所有的别名定义 返回成功,除非“名字”不是一个已存在的别名。 @@ -319,12 +243,12 @@ $cmdName -> 变量名。如果该变量有值,则它的值被当作 DIR 目录。 选项: - -L 强制跟随符号链接: 在处理 `..' 之后解析 DIR 中的符号链接。 - -P 使用物理目录结构而不跟随符号链接: 在处理 `..' 之前解析 DIR 中的符 + -L\t强制跟随符号链接: 在处理 `..' 之后解析 DIR 中的符号链接。 + -P\t使用物理目录结构而不跟随符号链接: 在处理 `..' 之前解析 DIR 中的符 号链接。 - -e 如果使用了 -P 参数,但不能成功确定当前工作目录时,返回非零的返回 + -e\t如果使用了 -P 参数,但不能成功确定当前工作目录时,返回非零的返回 值。 - -@ 在支持拓展属性的系统上,将一个有这些属性的文件当作有文件属性的目 + -@\t在支持拓展属性的系统上,将一个有这些属性的文件当作有文件属性的目 录。 默认情况下跟随符号链接,如同指定 `-L'。 @@ -336,8 +260,8 @@ $cmdName -> [pwd]打印当前工作目录的名字。 选项: - -L 打印 $PWD 变量的值,如果它包含了当前的工作目录 - -P 打印当前的物理路径,不带有任何的符号链接 + -L\t打印 $PWD 变量的值,如果它包含了当前的工作目录 + -P\t打印当前的物理路径,不带有任何的符号链接 默认情况下,`pwd' 的行为和带 `-L' 选项一致 @@ -357,11 +281,11 @@ $cmdName -> 同时标注每一个选项是否被设定。 选项: - -o 限制 OPTNAME 为定义用于`set -o' 的选项 - -p 打印每个 shell 选项并标注它的状态。 - -q 抑制输出 - -s 启用(设定)每个 OPTNAME 选项 - -u 禁用(取消设定)每个 OPTNAME 选项 + -o\t限制 OPTNAME 为定义用于`set -o' 的选项 + -p\t打印每个 shell 选项并标注它的状态。 + -q\t抑制输出 + -s\t启用(设定)每个 OPTNAME 选项 + -u\t禁用(取消设定)每个 OPTNAME 选项 退出状态: 如果 OPTNAME 选项被启用则返回成功;如果是 @@ -379,9 +303,9 @@ $cmdName -> 情况下用于启动磁盘上的命令。 选项: - -p 使用 PATH 变量的一个默认值以确保所有的标准工具都能被找到。 - -v 打印 COMMAND 命令的描述,和 `type' 内建相似 - -V 打印每个 COMMAND 命令的详细描述 + -p\t使用 PATH 变量的一个默认值以确保所有的标准工具都能被找到。 + -v\t打印 COMMAND 命令的描述,和 `type' 内建相似 + -V\t打印每个 COMMAND 命令的详细描述 退出状态 返回 COMMAND 命令的返回状态,或者当找不到 COMMAND 命令时失败。 @@ -391,29 +315,29 @@ $cmdName -> 在标准输出上,显示用空格分割的 ARG 参数后跟一个换行。 选项: - -n 不要追加换行 - -e 启用下列反斜杠转义的解释 - -E 显式地抑制对于反斜杠转义的解释 + -n\t不要追加换行 + -e\t启用下列反斜杠转义的解释 + -E\t显式地抑制对于反斜杠转义的解释 `echo' 对下列反斜杠字符进行转义: - \a 警告(响铃) - \\b 退格 - \\c 抑制更多的输出 - \\e 转义字符 - \\f 换页字符 + \a\t警告(响铃) + \\b\t退格 + \\c\t抑制更多的输出 + \\e\t转义字符 + \\f\t换页字符 \\t换行 \\r\t回车 \\t\t横向制表符 \\v\t纵向制表符 \\\\\t反斜杠 - \\0nnn 以 NNN(八进制)为 ASCII 码的字符。NNN 可以是 0 到 3 个八进制 + \\0nnn\t以 NNN(八进制)为 ASCII 码的字符。NNN 可以是 0 到 3 个八进制 位 - \\xHH 以 HH(十六进制)为值的八比特字符。HH 可以是一个或两个十六进制 + \\xHH\t以 HH(十六进制)为值的八比特字符。HH 可以是一个或两个十六进制 位 - \\uHHHH 以 HHHH(十六进制)为值的 Unicode 字符。HHHH 可以是一个到 - 四个十六进制位。 + \\uHHHH\t以 HHHH(十六进制)为值的 Unicode 字符。HHHH 可以是一个到 + \t\t四个十六进制位。 \\UHHHHHHHH 以 HHHHHHHH(十六进制)为值的 Unicode 字符。 - HHHHHHHH 可以是一到八个十六进制位。 + \t\tHHHHHHHH 可以是一到八个十六进制位。 退出状态: 返回成功除非有写错误发生。 @@ -423,7 +347,7 @@ $cmdName -> 在标准输出设备上显示 ARGs 参数和一个换行。 选项: - -n 不附加换行 + -n\t不附加换行 退出状态: 除非写错误发生,否则返回成功。 @@ -435,14 +359,14 @@ $cmdName -> 选项: - -a 打印一个内建的列表,并显示其中每一个是否启用 - -n 禁用每一个 NAME 内建或者显示一个被禁用的内建的列表 - -p 以可重用的格式打印一个内建的列表 - -s 仅打印Posix `special' 内建的名称 + -a\t打印一个内建的列表,并显示其中每一个是否启用 + -n\t禁用每一个 NAME 内建或者显示一个被禁用的内建的列表 + -p\t以可重用的格式打印一个内建的列表 + -s\t仅打印Posix `special' 内建的名称 控制动态加载的选项: - -f 从共享对象 FILENAME 文件中加载 NAME 内建 - -d 删除以 -f 选项加载的内建 + -f\t从共享对象 FILENAME 文件中加载 NAME 内建 + -d\t删除以 -f 选项加载的内建 不带选项时,每一个 NAME 内建都被启用。 @@ -497,9 +421,9 @@ $cmdName -> 没有指定COMMAND 命令,则任何的重定向在当前 shell 中生效。 选项: - -a 名称 作为第0个参数传递给 COMMAND 命令 - -c 在一个空环境中执行 COMMAND 命令 - -l 在COMMAND 命令的第0个参数中加一个短线 + -a 名称\t作为第0个参数传递给 COMMAND 命令 + -c\t\t在一个空环境中执行 COMMAND 命令 + -l\t\t在COMMAND 命令的第0个参数中加一个短线 如果命令不能被执行,则退出一个非交互式的 shell,除非 shell 选项`execfail' 已经设定。 @@ -525,11 +449,11 @@ $cmdName -> 选项: - -e ENAME 选择使用哪个编辑器。默认的是 FCEDIT, 然后是 EDITOR, - 然后是 vi - -l 列出行而不编辑 - -n 列举时省略行号 - -r 反转行的顺序(最新行在前) + -e ENAME\t选择使用哪个编辑器。默认的是 FCEDIT, 然后是 EDITOR, + \t\t然后是 vi + -l \t列出行而不编辑 + -n\t列举时省略行号 + -r\t反转行的顺序(最新行在前) 用 `fc -s [模式=替换 ...] [命令]' 的格式,COMMAND 命令会在 OLD=NEW 替换之后被重新执行。 @@ -565,15 +489,15 @@ $cmdName -> 如果不提供参数,则显示已经记住的命令的信息。 选项: - -d 忘记每一个已经记住的 NAME 的位置 - -l 以可作为输入重用的格式显示 - -p pathname 使用 pathname 路径作为 NAME 命令的全路径 - -r 忘记所有记住的位置 - -t 打印记住的每一个 NAME 名称的位置,如果指定了多个 - NAME 名称,则每个位置前面会加上相应的 NAME 名称 - + -d\t\t忘记每一个已经记住的 NAME 的位置 + -l\t\t以可作为输入重用的格式显示 + -p pathname\t使用 pathname 路径作为 NAME 命令的全路径 + -r\t\t忘记所有记住的位置 + -t\t\t打印记住的每一个 NAME 名称的位置,如果指定了多个 + \t\tNAME 名称,则每个位置前面会加上相应的 NAME 名称 + \t\t 参数: - NAME 每个 NAME 名称会在 $PATH 路径变量中被搜索,并且添加到记住的命 + NAME\t\t每个 NAME 名称会在 $PATH 路径变量中被搜索,并且添加到记住的命 令 列表中。 @@ -587,13 +511,13 @@ $cmdName -> 印一个帮助主题列表 选项: - -d 输出每个主题的简短描述 - -m 以伪 man 手册的格式显示使用方法 - -s 为每一个匹配 PATTERN 模式的主题仅显示一个用法 - 简介 + -d\t输出每个主题的简短描述 + -m\t以伪 man 手册的格式显示使用方法 + -s\t为每一个匹配 PATTERN 模式的主题仅显示一个用法 + \t简介 参数: - PATTERN 指定帮助主题的模式 + PATTERN\t指定帮助主题的模式 退出状态: 返回成功,除非未找到 PATTERN 模式没有找到或者使用了无效选项。 @@ -604,18 +528,18 @@ $cmdName -> 参数 N 会仅列出最后的 N 个条目。 选项: - -c 删除所有条目从而清空历史列表。 - -d 偏移量 从指定位置删除历史列表。负偏移量将从历史条目末尾 - 开始计数 + -c\t删除所有条目从而清空历史列表。 + -d 偏移量\t从指定位置删除历史列表。负偏移量将从历史条目末尾 + \t\t开始计数 - -a 将当前会话的历史行追加到历史文件中 - -n 从历史文件中读取所有未被读取的行 - 并且将它们附加到历史列表 - -r 读取历史文件并将内容追加到历史列表中 - -w 将当前历史写入到历史文件中 + -a\t将当前会话的历史行追加到历史文件中 + -n\t从历史文件中读取所有未被读取的行 + \t\t并且将它们附加到历史列表 + -r\t读取历史文件并将内容追加到历史列表中 + -w\t将当前历史写入到历史文件中 - -p 对每一个 ARG 参数展开历史并显示结果,而不存储到历史列表中 - -s 以单条记录追加 ARG 到历史列表中 + -p\t对每一个 ARG 参数展开历史并显示结果,而不存储到历史列表中 + -s\t以单条记录追加 ARG 到历史列表中 如果给定了 FILENAME 文件名,则它将被作为历史文件。否则 如果 $HISTFILE 变量有值的话使用之,不然使用 ~/.bash_history 文件。 @@ -632,11 +556,11 @@ $cmdName -> 不带选项时,所有活动任务的状态都会显示。 选项: - -l 在正常信息基础上列出进程号 - -n 仅列出上次通告之后改变了状态的进程 - -p 仅列出进程号 - -r 限制仅输出运行中的任务 - -s 限制仅输出停止的任务 + -l\t在正常信息基础上列出进程号 + -n\t仅列出上次通告之后改变了状态的进程 + -p\t仅列出进程号 + -r\t限制仅输出运行中的任务 + -s\t限制仅输出停止的任务 如果使用了 -x 选项,ARG 参数中的所有任务声明会被替换为该任务 的进程组头领的进程号,然后执行 COMMAND 命令。 @@ -651,10 +575,10 @@ $cmdName -> JOBSPEC 参数时,shell 使用观念中的当前任务。 选项: - -a 如果不提供 JOBSPEC 参数,则删除所有任务 - -h 标识每个 JOBSPEC 任务,从而当 shell 接收到 SIGHUP - 信号时不发送 SIGHUP 给指定任务 - -r 仅删除运行中的任务 + -a\t如果不提供 JOBSPEC 参数,则删除所有任务 + -h\t标识每个 JOBSPEC 任务,从而当 shell 接收到 SIGHUP + \t\t信号时不发送 SIGHUP 给指定任务 + -r\t仅删除运行中的任务 退出状态: 返回成功除非使用了无效的选项或者 JOBSPEC 声明。 @@ -666,10 +590,10 @@ $cmdName -> SIGSPEC 或 SIGNUM,那么假定发送 SIGTERM 信号。 选项: - -s sig SIG 是信号名称 - -n sig SIG 是信号编号 - -l 列出信号名称;如果参数后跟 `-l'则被假设为信号编号, - 而相应的信号名称会被列出 + -s sig\tSIG 是信号名称 + -n sig\tSIG 是信号编号 + -l\t列出信号名称;如果参数后跟 `-l'则被假设为信号编号, + \t\t而相应的信号名称会被列出 Kill 成为 shell 内建有两个理由:它允许使用任务编号而不是进程号, 并且在可以创建的进程数上限达到是允许进程被杀死。 @@ -727,7 +651,7 @@ $cmdName -> 登录 shell 不可以被挂起,除非强制执行。 选项: - -f 强制挂起,即使是登录 shell。 + -f\t强制挂起,即使是登录 shell。 退出状态: 返回成功,除非没有启用任务控制或者有错误发生。 @@ -818,29 +742,29 @@ $cmdName -> 资源的控制。 选项: - -S 使用软 (`soft') 资源限制 - -H 使用硬 (`hard') 资源限制 - -a 所有当前限制都被报告 - -b 套接字缓存尺寸 - -c 创建的核文件的最大尺寸 - -d 一个进程的数据区的最大尺寸 - -e 最高的调度优先级 (`nice') - -f 有 shell 及其子进程可以写的最大文件尺寸 - -i 最多的可以挂起的信号数 - -k 分配给此进程的最大 kqueue 数量 - -l 一个进程可以锁定的最大内存尺寸 - -m 最大的内存进驻尺寸 - -n 最多的打开的文件描述符个数 - -p 管道缓冲区尺寸 - -q POSIX 信息队列的最大字节数 - -r 实时调度的最大优先级 - -s 最大栈尺寸 - -t 最大的CPU时间,以秒为单位 - -u 最大用户进程数 - -v 虚拟内存尺寸 - -x 最大的文件锁数量 - -P 最大伪终端数量 - -T 最大线程数量 + -S\t使用软 (`soft') 资源限制 + -H\t使用硬 (`hard') 资源限制 + -a\t所有当前限制都被报告 + -b\t套接字缓存尺寸 + -c\t创建的核文件的最大尺寸 + -d\t一个进程的数据区的最大尺寸 + -e\t最高的调度优先级 (`nice') + -f\t有 shell 及其子进程可以写的最大文件尺寸 + -i\t最多的可以挂起的信号数 + -k\t分配给此进程的最大 kqueue 数量 + -l\t一个进程可以锁定的最大内存尺寸 + -m\t最大的内存进驻尺寸 + -n\t最多的打开的文件描述符个数 + -p\t管道缓冲区尺寸 + -q\tPOSIX 信息队列的最大字节数 + -r\t实时调度的最大优先级 + -s\t最大栈尺寸 + -t\t最大的CPU时间,以秒为单位 + -u\t最大用户进程数 + -v\t虚拟内存尺寸 + -x\t最大的文件锁数量 + -P\t最大伪终端数量 + -T\t最大线程数量 并非所有选项在所有系统上可用。 @@ -863,8 +787,8 @@ $cmdName -> chmod(1) 可接收的符号模式串。 选项: - -p 如果省略 MODE 模式,以可重用为输入的格式输入 - -S 以符号形式输出,否则以八进制数格式输出 + -p\t如果省略 MODE 模式,以可重用为输入的格式输入 + -S\t以符号形式输出,否则以八进制数格式输出 退出状态: 返回成功,除非使用了无效的 MODE 模式或者选项。 @@ -920,7 +844,7 @@ $cmdName -> CPU 时间的总结。 选项: - -p 用可迁移的 POSIX 格式打印用时总结。 + -p\t用可迁移的 POSIX 格式打印用时总结。 TIMEFORMAT 变量的值被作为输出格式。 @@ -974,45 +898,45 @@ $cmdName -> [variables] 常用 shell 变量名称和使用。 - BASH_VERSION 当前 Bash 的版本信息。 - CDPATH 用于 `cd' 命令参数搜索的分号分隔的目录列表 - GLOBIGNORE 路径扩展时忽略的文件名匹配模式列表, - 以分号分隔。 - HISTFILE 您的命令历史存放的文件名称。 - HISTFILESIZE 历史文件最多可以保存的行数。 - HISTSIZE 一个运行的 shell 最多可以访问的历史命令行数。 - HOME 您的登录目录的完整路径。 - HOSTNAME 当前主机的主机名。 - HOSTTYPE 当前版本的 BASH 在其之上运行的 CPU 类型。 - IGNOREEOF 控制 shell 收到文件结束符作为单一输入后的 - 动作。如果设定这个变量,则它的值是 shell 退出之前在 - 一个空行上可以连续看到的文件结束符数量(默认为10)。 - 未设定时,文件结束符标志着输入的结束。 - MACHTYPE 描述当前运行 Bash 的系统的字符串。 - MAILCHECK Bash 检测新邮件的频率,以秒为单位。 - MAILPATH Bash 从中检测新邮件的文件列表,以分号分隔。 - OSTYPE 运行 Bash 的 Unix 版本。 - PATH 当寻找命令时搜索的目录列表,以冒号分隔。 - PROMPT_COMMAND 打印每一个主提示符之前执行的命 - 令。 - PS1 主提示符字符串。 - PS2 从提示符字符串。 - PWD 当前目录的完整路径。 - SHELLOPTS 已启用的 shell 选项列表,以冒号分隔。 - TERM 当前终端类型的名称。 - TIMEFORMAT 以关键则 `time' 显示的时间统计信息的输出 - 格式。 - auto_resume 非空时,一个单独的命令词会首先被在当前 - 停止的任务列表中搜索。如果找到则该任务被置于前台。 - 如果值为 `exact' 则意味着命令词必须精确匹配停止任务 - 列表中的命令。如果值为 `substring' 则意味着命令词必 - 须匹配任务的一个子字符串。任何其他的值意味着命令词 - 必须是停止任务的一个前缀。 - histchars 控制历史展开和快速替换的字符。第一个字符是 - 历史替换字符,通常是 `!'。第二个字符是快速替换字符, - 通常是 `^'。第三个是历史注释字符,通常是 `#'。 - HISTIGNORE 用于决定哪些命令被存入历史文件的模式 - 列表,以冒号分隔。 + BASH_VERSION\t当前 Bash 的版本信息。 + CDPATH\t用于 `cd' 命令参数搜索的分号分隔的目录列表 + GLOBIGNORE\t路径扩展时忽略的文件名匹配模式列表, + \t\t以分号分隔。 + HISTFILE\t您的命令历史存放的文件名称。 + HISTFILESIZE\t历史文件最多可以保存的行数。 + HISTSIZE\t一个运行的 shell 最多可以访问的历史命令行数。 + HOME\t您的登录目录的完整路径。 + HOSTNAME\t当前主机的主机名。 + HOSTTYPE\t当前版本的 BASH 在其之上运行的 CPU 类型。 + IGNOREEOF\t控制 shell 收到文件结束符作为单一输入后的 + \t\t动作。如果设定这个变量,则它的值是 shell 退出之前在 + \t\t一个空行上可以连续看到的文件结束符数量(默认为10)。 + \t\t未设定时,文件结束符标志着输入的结束。 + MACHTYPE\t描述当前运行 Bash 的系统的字符串。 + MAILCHECK\tBash 检测新邮件的频率,以秒为单位。 + MAILPATH\tBash 从中检测新邮件的文件列表,以分号分隔。 + OSTYPE\t运行 Bash 的 Unix 版本。 + PATH\t当寻找命令时搜索的目录列表,以冒号分隔。 + PROMPT_COMMAND\t打印每一个主提示符之前执行的命 + \t\t令。 + PS1\t\t主提示符字符串。 + PS2\t\t从提示符字符串。 + PWD\t\t当前目录的完整路径。 + SHELLOPTS\t已启用的 shell 选项列表,以冒号分隔。 + TERM\t当前终端类型的名称。 + TIMEFORMAT\t以关键则 `time' 显示的时间统计信息的输出 + \t\t格式。 + auto_resume\t非空时,一个单独的命令词会首先被在当前 + \t\t停止的任务列表中搜索。如果找到则该任务被置于前台。 + \t\t如果值为 `exact' 则意味着命令词必须精确匹配停止任务 + \t\t列表中的命令。如果值为 `substring' 则意味着命令词必 + \t\t须匹配任务的一个子字符串。任何其他的值意味着命令词 + \t\t必须是停止任务的一个前缀。 + histchars\t控制历史展开和快速替换的字符。第一个字符是 + \t\t历史替换字符,通常是 `!'。第二个字符是快速替换字符, + \t\t通常是 `^'。第三个是历史注释字符,通常是 `#'。 + HISTIGNORE\t用于决定哪些命令被存入历史文件的模式 + \t\t列表,以冒号分隔。 [pushd] 将目录添加到栈中。 @@ -1020,17 +944,17 @@ $cmdName -> 新的栈顶。不带参数时,交换栈顶的两个目录。 选项: - -n 抑制添加目录至栈时通常的改变目录操作,从而仅对栈 - 进行操作。 + -n\t抑制添加目录至栈时通常的改变目录操作,从而仅对栈 + \t进行操作。 参数: - +N 旋转栈从而第 N 个目录 (`dirs' 显示的列表中左起,从零开始) - 将移动到栈顶。 + +N\t旋转栈从而第 N 个目录 (`dirs' 显示的列表中左起,从零开始) + \t将移动到栈顶。 - -N 旋转栈从而第 N 个目录 (`dirs' 显示的列表中右起,从零开始) - 将移动到栈顶。 + -N\t旋转栈从而第 N 个目录 (`dirs' 显示的列表中右起,从零开始) + \t将移动到栈顶。 - dir 将 DIR 目录添加到栈顶,并且使其成为当前工作目录。 + dir\t将 DIR 目录添加到栈顶,并且使其成为当前工作目录。 `dirs' 内建显示目录栈。 @@ -1042,15 +966,15 @@ $cmdName -> 顶目录。 选项: - -n 抑制从栈中删除目录时通常的目录变换操作,从而仅对栈 - 进行操作。 + -n\t抑制从栈中删除目录时通常的目录变换操作,从而仅对栈 + \t进行操作。 参数: - +N 删除第 N 个目录 (`dirs' 显示的目录列表中左起,从零开始)。 - 例如:`popd +0' 删除第一个目录,`popd +1' 删除第二个。 + +N\t删除第 N 个目录 (`dirs' 显示的目录列表中左起,从零开始)。 + \t例如:`popd +0' 删除第一个目录,`popd +1' 删除第二个。 - -N 删除第 N 个目录 (`dirs' 显示的目录列表中右起,从零开始)。 - 例如:`popd -0' 删除最后一个目录,,`popd -1' 删除倒数第二个。 + -N\t删除第 N 个目录 (`dirs' 显示的目录列表中右起,从零开始)。 + \t例如:`popd -0' 删除最后一个目录,,`popd -1' 删除倒数第二个。 `dirs' 内建显示目录栈。 @@ -1063,17 +987,17 @@ $cmdName -> 中;`popd' 命令可用于遍历弹出列表。 选项: - -c 删除所有元素以清空目录栈 - -l 不打印与主目录相关的波浪号前缀的目录 - -p 每行一个条目打印目录栈 - -v 每行一个条目,以栈中位置为前缀打印目录栈 + -c\t删除所有元素以清空目录栈 + -l\t不打印与主目录相关的波浪号前缀的目录 + -p\t每行一个条目打印目录栈 + -v\t每行一个条目,以栈中位置为前缀打印目录栈 参数: - +N 显示 dirs 不带选项启动时显示的目录列表左起中第 - N 个目录,从零开始。 + +N\t显示 dirs 不带选项启动时显示的目录列表左起中第 + \tN 个目录,从零开始。 - -N 显示 dirs 不带选项启动时显示的目录列表右起中第 - N 个目录,从零开始。 + -N\t显示 dirs 不带选项启动时显示的目录列表右起中第 + \tN 个目录,从零开始。 退出状态: 返回成功,除非使用了无效的选项或者发生错误。 @@ -1081,7 +1005,7 @@ $cmdName -> [printf] 在 FORMAT 的控制下格式化并打印 ARGUMENTS 参数。 选项: - -v var 将输出赋值给 shell 变量 VAR 而不显示在标准输出上 + -v var\t将输出赋值给 shell 变量 VAR 而不显示在标准输出上 FORMAT 是包含三种对象的字符串:简单地被拷贝到标准输出的普通字符; 被变换之后拷贝到标准输入的转义字符;以及每个都会影响到下个参数的打印的格 @@ -1089,9 +1013,9 @@ $cmdName -> 在 printf(1) 中描述的标准控制声明之外,printf 解析: - %b 扩展对应参数中的反斜杠转义序列 - %q 以可作为 shell 输入的格式引用参数 - %(fmt)T 以 FMT 为供给 strftime(3) 的格式输出日期时间字符串 + %b\t扩展对应参数中的反斜杠转义序列 + %q\t以可作为 shell 输入的格式引用参数 + %(fmt)T\t以 FMT 为供给 strftime(3) 的格式输出日期时间字符串 退出状态: 返回成功,除非使用了无效的选项或者写或赋值错误发生。 @@ -1102,12 +1026,12 @@ $cmdName -> 现有的补全声明会以可以重用为输入的格式打印出来。 选项: - -p 以可重用的格式打印现有的补全声明。 - -r 对于每个 NAME 名称删除补全声明,或者如果没有提供 NAME - 名称,删除所有的补全声明。 - -D 对于没有补全声明定义的命令,设定默认的补全动作 - -E 对于 \empty\ 命令设定补全动作,—— 对于空行的补全。 - -I 将补全和动作应用在首单词(通常是所给命令)上 + -p\t以可重用的格式打印现有的补全声明。 + -r\t对于每个 NAME 名称删除补全声明,或者如果没有提供 NAME + \t名称,删除所有的补全声明。 + -D\t对于没有补全声明定义的命令,设定默认的补全动作 + -E\t对于 \empty\ 命令设定补全动作,—— 对于空行的补全。 + -I\t将补全和动作应用在首单词(通常是所给命令)上 尝试补全时,按照上述大写字母选项的顺序进行动作。 如果给出了多个选项,-D 选项优先级高于 -E 选项,且 @@ -1132,10 +1056,10 @@ $cmdName -> 如果不带选项,打印每个 NAME 名称的补全选项或当前的补全声明。 选项: - -o option 为每个 NAME 名称设定补全选项 option - -D 为 \default\ 命令补全改变选项 - -E 为 \empty\ 命令补全改变选项 - -I 为首单词的补全改变选项 + \t-o option\t为每个 NAME 名称设定补全选项 option + \t-D\t\t为 \default\ 命令补全改变选项 + \t-E\t\t为 \empty\ 命令补全改变选项 + \t-I\t\t为首单词的补全改变选项 使用 `+o' 而不是 `-o' 可以关闭指定的选项。 @@ -1155,17 +1079,17 @@ $cmdName -> 从文件描述符 FD 中读取。MAPFILE 变量是默认的 ARRAY 变量。 选项: - -d delim 使用 DELIM 而非换行符断行 - -n count 最多拷贝 COUNT 行,如果 COUNT 为 0,则拷贝所有行。 - -O origin 从下标 ORIGIN 开始 赋值给 ARRAY 变量。默认下标是0. - -s count 丢弃最先读取的 COUNT 行。 - -t 从读取的每行末尾删除一个换行符。 - -u fd 从文件描述符 FD 中读取行而不是标准输入。 - -C callback 每 QUANTUM 次读行之后对 CALLBACK 回调进行估值。 - -c quantum 定义每次调用 CALLBACK 回调之间读取的行数。 + -d delim\t使用 DELIM 而非换行符断行 + -n count\t最多拷贝 COUNT 行,如果 COUNT 为 0,则拷贝所有行。 + -O origin\t从下标 ORIGIN 开始 赋值给 ARRAY 变量。默认下标是0. + -s count \t丢弃最先读取的 COUNT 行。 + -t\t\t从读取的每行末尾删除一个换行符。 + -u fd\t\t从文件描述符 FD 中读取行而不是标准输入。 + -C callback\t每 QUANTUM 次读行之后对 CALLBACK 回调进行估值。 + -c quantum\t定义每次调用 CALLBACK 回调之间读取的行数。 参数: - ARRAY 存储数据使用的数组变量 + ARRAY\t\t存储数据使用的数组变量 如果使用了 -C 而没有 -c,默认的量子是5000。当对 CALLBACK 估值时, 下一个将被赋值的数组元素的下标作为额外参数被传递。 @@ -1182,9 +1106,9 @@ $cmdName -> 对每一个 NAME 名称,删除对应的变量或函数。 选项: - -f 将每个 NAME 视为函数 - -v 将每个 NAME 视为变量 - -n 将每个 NAME 视为名称引用,只取消其本身而非其指向的变量 + -f\t将每个 NAME 视为函数 + -v\t将每个 NAME 视为变量 + -n\t将每个 NAME 视为名称引用,只取消其本身而非其指向的变量 不带选项时,unset 首先尝试取消设定一个变量,如果失败,再尝试取消设定一个 函数。 @@ -1247,38 +1171,6 @@ $cmdName -> 退出状态: 返回成功,除非使用了无效的选项或者 NAME 名称。 - [declare] 设定变量值和属性。 - - 声明变量并且赋予它们属性。如果没有给定名称, - 则显示所有变量的属性和值。 - - 选项: - -f 限制动作或显示为仅函数名称和定义 - -F 限制仅显示函数名称 (以及调试时显示行号和源文件名) - -g 当用于 shell 函数内时创建全局变量; 否则忽略 - -p 显示每个 NAME 变量的属性和值 - - 设定属性的选项: - -a 使 NAME 成为下标数组 (如果支持) - -A 使 NAME 成为关联数组 (如果支持) - -i 使 NAME 带有 `integer' (整数)属性 - -l 将 NAME 在赋值时转为小写 - -n 使 NAME 成为指向一个以其值为名称的变量的引用 - -r 将 NAME 变为只读 - -t 使 NAME 带有 `trace' (追踪)属性 - -u 将每个 NAME 在赋值时转为大写 - -x 将 NAME 导出 - - 用 `+' 代替 `-' 会关闭指定选项。 - - 带有整数属性的变量在赋值时将使用算术估值(见 - `let' 命令) - - 在函数中使用时,`declare' 使 NAME 成为本地变量,和 `local' - 命令一致。`-g' 选项抑制此行为。 - - 退出状态: - 返回成功,除非提供了无效选项或者发生变量赋值错误 [function] 定义 shell 函数。 @@ -1290,6 +1182,7 @@ $cmdName -> 退出状态: 返回成功除非 NAME 为只读。 + [typeset] 设置变量的值和属性。 `declare' 的等价形式。参见 `help declare'。 @@ -1377,14 +1270,6 @@ $cmdName -> helpname = { $cmdName -> -[command0] {" % - 在前台继续任务"} -[command1] {"(( - 估值条件表达式。"} -[command2] {". 文件名 [参数]"} -[command3] {":"} -[command4] {"[ 参数... ]"} -[command5] {"[[ 表达式 ]]"} -[command6] {"for (( - 算术 for 循环。"} -[command7] 将命令组合为一个单元。 [set] set - 设定或取消设定 shell 选项和位置参数的 [read] read - 从标准输入读取一行并将其分为不同的域。 [type] type - 显示命令类型的信息。 @@ -1452,20 +1337,11 @@ $cmdName -> [source] source - 在当前 shell 中执行一个文件中的命令。 [bind] bind - 设定 Readline 键绑定和变量。 [test] test - 估值算术表达式。 -[declare] declare - 设置变量的值和属性。 *[other] 显示其他命令帮助信息 . } helpsynopsis = { $cmdName -> -[command0] {"job_spec [&]"} -[command1] {"(( - "} -[command2] {". - 在当前 shell 中执行一个文件中的命令。"} -[command3] {": - 空的命令。"} -[command4] {"[ - 估值条件表达式。"} -[command5] {"[[ ... ]] - 执行条件命令。"} -[command6] {"for (( 表达式1; 表达式2; 表达式3 )); do 命令 ; done"} -[command7] {"{ 命令 ; }"} [set] {"set [--abefhkmnptuvxBCHP][-o 选项名][--][参数 ...]"} [read] {"read [-ers] [-a 数组] [-d 分隔符] [-i 缓冲区文字] [-n 读取字符数] [-N 读取字符数] [-p 提示符] [-t 超时] [-u 文件描述符] [名称 ...]"} [type] {"type [-afptP] 名称 [名称 ...]"} @@ -1533,11 +1409,5 @@ $cmdName -> [source] {"source 文件名 [参数]"} [bind] {"bind [-lpvsPSVX] [-m 键映射] [-f 文件名] [-q 名称] [-u 名称] [-r 键序列] [-x 键序列:shell-命令] [键序列:readline-函数 或 readline-命令] "} [test] {"test [表达式]"} -[declare] {"declare [-aAfFgilnrtux] [-p] [名称[=值] ...]"} *[other] 显示其他命令帮助信息 . } - -information = 这些 shell 命令是内部定义的。请输入 `help' 以获取一个列表。 - 输入 `help 名称' 以得到有关函数`名称'的更多信息。 - 使用 `info bash' 来获得关于 shell 的更多一般性信息。 - 使用 `man -k' 或 `info' 来获取不在列表中的命令的更多信息。 \ No newline at end of file diff --git a/record.txt b/record.txt index e8852049677b07dd49010674986e0e62b33a3cf5..05996ab808f353f230a57dadd282ad568b4259b4 100644 --- a/record.txt +++ b/record.txt @@ -69,3 +69,6 @@ 68 69 70 +71 +72 +73