Centos 7 c-shell if: Expression Syntax ¹ß»ý.

amplifier   
   Á¶È¸ 6102   Ãßõ 0    

 안녕하세요?

최근에 Centos 7으로 어쩔 수 없이 업데이트하였습니다.

그런데 c-shell를 적용하는 과정에서 syntax error가 발생하여 도움을 얻고자 게시글을 작성합니다.


OS Centos 7 이며 커널 정보는 아래와 같습니다.

[root@wyverns ~]# uname -r

3.10.0-1062.el7.x86_64

[root@wyverns ~]# cat /proc/version 

Linux version 3.10.0-1062.el7.x86_64 (*********@********.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Wed Aug 7 18:08:02 UTC 2019

기존 bash shell에서는 아무런 내용이 안뜨는데,

계정을 passwd 에서 c-shell로 적용할 경우, 아래와 같은 에러가 뜹니다.

Last login: Wed Apr  8 16:07:25 2020 from 192.168.0.57

if: Expression Syntax.

[root@wyverns ~]# 


이 상태에서 source .cshrc을 하게 될 경우 정상적으로 c-shell이 적용됩니다.


위 과정은 모두 DVD로 clean 설치한 이후 발생한 내용입니다.

여기서 if: Expression Syntax 에러가 발생하는 원인과 해결 방법을 알고 싶습니다.




안녕하세요
ªÀº±Û Àϼö·Ï ½ÅÁßÇÏ°Ô.
amplifier 2020-04
³»¿ëÀ» Ãß°¡ÇÏÀÚ¸é,

Á¶»çÇÑ ¹Ù·Î´Â c-shellÀº óÀ½¿¡
/etc/csh.cshrc ¿Í /etc/csh.login 2ÆÄÀÏÀ» sourcing Çϴ°ÍÀ¸·Î ³ª¿É´Ï´Ù.

ÀÌ ¶§, /etc/csh.login ¿¡¼­
if ( -d /etc/profile.d ) then
        set nonomatch
        foreach i ( /etc/profile.d/*.csh /etc/profile.d/csh.local )
                if ( -r "$i" ) then
                                if ($?prompt) then
                                      source "$i"
                                else
                                      source "$i" >& /dev/null
                                endif
                endif
        end
        unset i nonomatch
endif

ÀÌ ³»¿ëÀ» ó¸®ÇÏ´Â °úÁ¤¿¡¼­ À§¿Í °°Àº error°¡ ³ª¿À´Â °ÍÀ¸·Î È®ÀÎÇÏ¿´½À´Ï´Ù.
~/.login

µµ ¿Ã·ÁÁּžß...
     
amplifier 2020-04
OS clean ¼³Ä¡ÀÌÈÄ, /etc/csh.login À̳ª /etc/csh.cshrc ¸¦ ¼öÁ¤ÇÏÁø ¾Ê¾Ò½À´Ï´Ù.

¾Æ·¡´Â /etc/csh.login ÆÄÀÏ ³»¿ëÀÔ´Ï´Ù.
# /etc/csh.login

# System wide environment and startup programs, for login setup

#add sbin directories to the path
foreach p ( /usr/local/sbin /usr/sbin )
        switch (":${PATH}:")
        case "*:${p}:*":
                breaksw
        default:
                if ( $uid == 0 ) then
                        set path = ( ${p} ${path:q} )
                else
                        set path = ( ${path:q} ${p} )
                endif
                breaksw
        endsw
end

setenv HOSTNAME `/usr/bin/hostname`
set history=1000

if ( -d /etc/profile.d ) then
        set nonomatch
        foreach i ( /etc/profile.d/*.csh /etc/profile.d/csh.local )
                if ( -r "$i" ) then
                                if ($?prompt) then
                                      source "$i"
                                else
                                      source "$i" >& /dev/null
                                endif
                endif
        end
        unset i nonomatch
endif
amplifier 2020-04
ÇØ°áÃ¥À» ¹ß°ßÇÏ¿©, ¿©±â ´ñ±Û¿¡ ³²±é´Ï´Ù.
RHEL 7 ¶Ç´Â CENTOS 7 OS¿¡ Á¸ÀçÇÏ´Â ¹ö±×ÀÔ´Ï´Ù.
ÀÌ ¹ö±×´Â cshÀ» »ç¿ëÇÏ´Â °èÁ¤À» ·Î±×ÀÎÇÏ´Â °úÁ¤Áß, sourcingµÇ´Â ÆÄÀÏµé ³»¿ëµé Áß¿¡¼­ csh ÇüÅ°¡ ¾Æ´Ñ bash ÇüÅÂÀÇ if ¹®¹ýÀÌ ³²¾Æ À־ ¹ß»ýÇÑ ¹®Á¦ÀÔ´Ï´Ù.
¾Õ¼­ ÀÌ·¯ÇÑ ¹ö±×´Â report°¡ µÇ¾úÀ¸¸ç, À̸¦ fixÇϱâ À§ÇÑ ³»¿ëµµ ÀÌ¹Ì ¾÷µ¥ÀÌÆ® µÈ »óÅÂÀÔ´Ï´Ù.
ÇØ°á ¹æ¹ýÀº yum install kde-settings °úÁ¤À» ÅëÇØ, ¾÷µ¥ÀÌÆ® ÇÏ°Ô µÇ¸é, csh login °úÁ¤¿¡¼­ ¹ß»ýÇÏ´Â if: Expression Syntax ¹®Á¦°¡ ÇØ°áµË´Ï´Ù.

ÇØ°áÃ¥À» ãÀº ¸µÅ©´Â ¾Æ·¡¿¡ ³»¿ëÀ» º¸°í ÇØ°áÇÏ¿´½À´Ï´Ù.
https://bugzilla.redhat.com/show_bug.cgi?id=1738491

Àú¿Í ºñ½ÁÇÑ ¹®Á¦¸¦ °Þ´Â »ç¶÷µéµµ ÀÌ ³»¿ëÀ» º¸°í ²À ÇØ°áÇϼÌÀ¸¸é ÁÁ°Ú½À´Ï´Ù.


QnA
Á¦¸ñPage 1991/5663
2015-12   1435720   ¹é¸Þ°¡
2014-05   4896893   Á¤ÀºÁØ1
2005-05   5858   ±è°Ç¿ì
2006-08   5858   ÀÌÁ¦È£
2006-10   5858   ±èµµÇü
2012-04   5858   °¡·ç¼Ç
2016-02   5858   Â÷ºÐÇÏ°ÔÇÏÀÚ
2012-08   5858   ȲȥÀ»ÇâÇØ
2005-06   5858   ±è°æÈ£
2016-06   5858   ±è°Ç¿ì
2023-01   5858   osthek83
2011-07   5857   ¼­¿ïl½Â¿ë
2008-10   5857   ¹ÚÁø±¹
2009-12   5857   Á¶¿µ¿í
2015-12   5857   Çʸ³
2006-02   5857   ¾ç°æ¸ð
2013-04   5857   ÀÓÁ¾±Õ
2005-11   5857   ±èÇüä
2006-03   5857   È«Çöö
2014-01   5857   À©µµ¿ì10
2012-10   5857   boardman
2005-05   5857   ¹ÚÁ¾ÀÍ