免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123
最近访问板块 发新帖
楼主: Ericzhao82
打印 上一主题 下一主题

[FreeBSD] 关于启动软件(已解决,谢谢congli 及gvim 朋友) [复制链接]

论坛徽章:
0
21 [报告]
发表于 2006-02-21 13:47 |只看该作者
谢谢楼上2位大大。

问题已经解决。
以为学习FB期间,我把系统还原了一次,所以Shell就从原来更改后的Bash又还原成最初的Csh

耽误2位的宝贵时间了,真抱歉,原来错误因为小小倏忽所致


对于2位耐心、认真指教。再谢!

论坛徽章:
2
亥猪
日期:2014-03-19 16:36:35午马
日期:2014-11-23 23:48:46
22 [报告]
发表于 2006-02-21 13:49 |只看该作者
原帖由 congli 于 2006-2-21 13:39 发表
不建议把root的shell换成其他的.


是的确实如此,但是我不是管理员,瓦哈哈哈哈 。

Ericzhao82
需要logout重新登录才可以生效

论坛徽章:
1
寅虎
日期:2013-09-29 23:15:15
23 [报告]
发表于 2006-02-21 13:49 |只看该作者
习惯了就好.
把下面放到~/.cshrc,就好用了.
alias ls        ls -wG
set autolist


或者试运行下面命令,重建一下:
# pwd_mkdb /etc/master.passwd

论坛徽章:
0
24 [报告]
发表于 2006-02-21 23:27 |只看该作者

Do you read manpage?

man bash

...

INVOCATION
       A  login  shell  is  one whose first character of argument
       zero is a -, or one started with the --login option.

       An interactive shell is  one  started  without  non-option
       arguments  and  without the -c option whose standard input
       and output are both connected to terminals (as  determined
       by  isatty(3)), or one started with the -i option.  PS1 is
       set and $- includes i if bash is interactive,  allowing  a
       shell script or a startup file to test this state.

       The  following  paragraphs  describe how bash executes its
       startup files.  If any of the files exist  but  cannot  be
       read,  bash reports an error.  Tildes are expanded in file
       names as described below  under  Tilde  Expansion  in  the
       EXPANSION section.

       When  bash is invoked as an interactive login shell, or as
       a non-interactive shell with the --login option, it  first
       reads and executes commands from the file /etc/profile, if
       that file exists.  After reading that file, it  looks  for
       ~/.bash_profile,  ~/.bash_login,  and  ~/.profile, in that
       order, and reads and executes commands from the first  one
       that  exists  and is readable.  The --noprofile option may
       be used when the shell is started to inhibit  this  behav-
       ior.

       When a login shell exits, bash reads and executes commands
       from the file ~/.bash_logout, if it exists.

       When an interactive shell that is not  a  login  shell  is
       started,  bash reads and executes commands from ~/.bashrc,
       if that file exists.  This may be inhibited by  using  the
       --norc  option.   The --rcfile file option will force bash
       to  read  and  execute  commands  from  file  instead   of
       ~/.bashrc.
        
       When  bash  is  started  non-interactively, to run a shell
       script, for example, it looks for the variable BASH_ENV in
       the  environment,  expands  its value if it appears there,
       and uses the expanded value as the name of a file to  read
       and  execute.   Bash  behaves  as if the following command
       were executed:
              if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi
       but the value of the PATH variable is not used  to  search
       for the file name.

       If bash is invoked with the name sh, it tries to mimic the
       startup behavior of historical versions of sh  as  closely
       as  possible,  while  conforming  to the POSIX standard as
       well.  When invoked as an interactive login  shell,  or  a
       non-interactive  shell  with  the --login option, it first
       attempts to read and execute  commands  from  /etc/profile
       and ~/.profile, in that order.  The --noprofile option may
       be used to inhibit this  behavior.   When  invoked  as  an
       interactive  shell  with  the  name sh, bash looks for the
       variable ENV, expands its value if it is defined, and uses
       the  expanded value as the name of a file to read and exe-
       cute.  Since a shell invoked as sh  does  not  attempt  to
       read  and  execute  commands from any other startup files,
       the --rcfile option  has  no  effect.   A  non-interactive
       shell  invoked  with  the name sh does not attempt to read
       any other startup files.  When invoked as sh, bash  enters
       posix mode after the startup files are read.

       When  bash  is  started in posix mode, as with the --posix
       command line option, it follows  the  POSIX  standard  for
       startup  files.   In  this mode, interactive shells expand
       the ENV variable and commands are read and  executed  from
       the  file  whose  name  is  the  expanded value.  No other
       startup files are read.

       Bash attempts to determine when it is  being  run  by  the
       remote  shell daemon, usually rshd.  If bash determines it
       is being run by rshd, it reads and executes commands  from
       ~/.bashrc,  if  that file exists and is readable.  It will
       not do this if invoked as sh.  The --norc  option  may  be
       used to inhibit this behavior, and the --rcfile option may
       be used to force another file to be read,  but  rshd  does
       not generally invoke the shell with those options or allow
       them to be specified.

       If the shell is started with the effective user (group) id
       not  equal  to the real user (group) id, and the -p option
       is not supplied, no startup files are  read,  shell  func-
       tions  are  not  inherited from the environment, the SHEL-
       LOPTS variable, if  it  appears  in  the  environment,  is
       ignored, and the effective user id is set to the real user
       id.  If the -p  option  is  supplied  at  invocation,  the
       startup behavior is the same, but the effective user id is
       not reset.

论坛徽章:
0
25 [报告]
发表于 2006-02-21 23:32 |只看该作者

You can use source

"需要logout重新登录才可以生效"
You can use "source".

man tcsh

source [-h] name [args ...]
               The  shell  reads and executes commands from name.
               The commands are not placed on the  history  list.
               If  any  args  are given, they are placed in argv.
               (+) source commands may be  nested;  if  they  are
               nested  too  deeply  the shell may run out of file
               descriptors.  An error in a source  at  any  level
               terminates  all  nested source commands.  With -h,
               commands are placed on the history list instead of
               being executed, much like `history -L'.

man bash


       source filename [arguments]
              Read and execute commands from filename in the cur-
              rent shell environment and return the  exit  status
              of  the  last  command  executed from filename.  If
              filename does not contain a slash,  file  names  in
              PATH  are  used  to  find  the directory containing
              filename.  The file searched for in PATH  need  not
              be executable.  When bash is not in posix mode, the
              current directory is searched if no file  is  found
              in  PATH.   If  the  sourcepath option to the shopt
              builtin command is turned  off,  the  PATH  is  not
              searched.   If  any  arguments  are  supplied, they
              become the positional parameters when  filename  is
              executed.   Otherwise the positional parameters are
              unchanged.  The return status is the status of  the
              last command exited within the script (0 if no com-
              mands are executed), and false if filename  is  not
              found or cannot be read.

论坛徽章:
0
26 [报告]
发表于 2006-02-22 08:56 |只看该作者
^_^
谢谢楼上朋友

问题已解决,谢谢

论坛徽章:
0
27 [报告]
发表于 2006-02-23 08:53 |只看该作者
rc.local
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP