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

amplifier   
   Á¶È¸ 5536   Ãßõ 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 84/5586
2014-05   4472138   Á¤ÀºÁØ1
2015-12   1025541   ¹é¸Þ°¡
2023-11   1065   yummy
2023-11   1049   starname
2023-11   907   Á¤ÀǼ®
2023-11   862   À±ÀçÈÆ
2023-11   920   ¾Æ¸¶µ¥¿ì¾²
2023-11   986   Caig
2023-11   825   °ËÀºÄá
2023-11   601   ±è¹ÎöGC
2023-11   533   º´¸ÀÆù
2023-11   875   yummy
2023-11   594   yummy
2023-11   723   Rich
2023-11   1213   ü½ºÅÍ
2023-11   1208   ¾Ö´Ï¾Ç
2023-11   994   ÇÑÁßÀÏ
2023-11   884   À̸ŸÁ·®2
2023-11   830   ÀÌ¿µ±Ô
2023-11   679   ¹¹µçÆȾƿä
2023-11   999   ȸ¿ø
2023-11   850   VSPress