IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Shell et commandes POSIX Discussion :

Problème avec un fichier normal sous AIX


Sujet :

Shell et commandes POSIX

  1. #1
    Membre régulier
    Profil pro
    Inscrit en
    Juin 2009
    Messages
    70
    Détails du profil
    Informations personnelles :
    Âge : 54
    Localisation : France, Rhône (Rhône Alpes)

    Informations forums :
    Inscription : Juin 2009
    Messages : 70
    Points : 92
    Points
    92
    Par défaut Problème avec un fichier normal sous AIX
    Bonjour.

    Voici mon problème :

    Hier j'ouvre un "vi" pour un nouveau script :
    Voici le résultat ce matin ... mon collègue a résolu ce problème en une minute, il a trouvé cela rigolo et intéressant.
    ... Bravo

    Voici le problème, je vous donne la solution en début d'aprem ... ;-)

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    [root@SAIX61SPTNIM] /home/secu # ls
    Start_Chk_Sec.sh              listes         motd           out            scripts        www
    bin            log            ori            reports     
    [root@SAIX61SPTNIM] /home/secu # vi Start_Chk_Sec.sh
    =>	ouverture vi avec rien (ouverture en fichier vide)
    [root@SAIX61SPTNIM] /home/secu # ll
    total 64
    -rw-r-----    1 collect  collect        1440 Jul 29 17:10 Start_Chk_Sec.sh
    drwx------    2 collect  collect         256 Jul 29 15:52 bin
    drwxrwx---    3 collect  collect        4096 Jul 29 15:40 listes
    drwx------    2 collect  collect         256 Jul 28 15:37 log
    drwx------    2 collect  collect        4096 Jul 29 17:06 motd
    drwx------    2 collect  collect        4096 Jul 28 15:07 ori
    drwx------    2 collect  collect        4096 Jul 29 10:29 out
    drwxr-xr-x    3 collect  collect        4096 Jul 29 09:38 reports
    drwx------    3 collect  collect        4096 Jul 29 15:52 scripts
    drwxr-s---   10 collect  nobody         4096 Jul 23 15:21 www
    [root@SAIX61SPTNIM] /home/secu # vi Start_Chk_Sec.sh
    =>	ouverture vi avec rien (ouverture en fichier vide)
    [root@SAIX61SPTNIM] /home/secu # chmod 740 Start_Chk_Sec.sh
    chmod: Start_Chk_Sec.sh: A file or directory in the path name does not exist.
    [root@SAIX61SPTNIM] /home/secu # ls -l
    total 64
    -rw-r-----    1 collect  collect        1440 Jul 29 17:10 Start_Chk_Sec.sh
    drwx------    2 collect  collect         256 Jul 29 15:52 bin
    drwxrwx---    3 collect  collect        4096 Jul 29 15:40 listes
    drwx------    2 collect  collect         256 Jul 28 15:37 log
    drwx------    2 collect  collect        4096 Jul 29 17:06 motd
    drwx------    2 collect  collect        4096 Jul 28 15:07 ori
    drwx------    2 collect  collect        4096 Jul 29 10:29 out
    drwxr-xr-x    3 collect  collect        4096 Jul 29 09:38 reports
    drwx------    3 collect  collect        4096 Jul 29 15:52 scripts
    drwxr-s---   10 collect  nobody         4096 Jul 23 15:21 www
    [root@SAIX61SPTNIM] /home/secu # chmod 740 ./Start_Chk_Sec.sh
    chmod: ./Start_Chk_Sec.sh: A file or directory in the path name does not exist.
    [root@SAIX61SPTNIM] /home/secu # ls -al
    total 72
    drwxr-x---   11 collect  nobody         4096 Jul 30 08:59 .
    drwxr-xr-x    7 collect  collect         256 Jul 23 14:31 ..
    -rw-r-----    1 collect  collect        1440 Jul 29 17:10 Start_Chk_Sec.sh
    drwx------    2 collect  collect         256 Jul 29 15:52 bin
    drwxrwx---    3 collect  collect        4096 Jul 29 15:40 listes
    drwx------    2 collect  collect         256 Jul 28 15:37 log
    drwx------    2 collect  collect        4096 Jul 29 17:06 motd
    drwx------    2 collect  collect        4096 Jul 28 15:07 ori
    drwx------    2 collect  collect        4096 Jul 29 10:29 out
    drwxr-xr-x    3 collect  collect        4096 Jul 29 09:38 reports
    drwx------    3 collect  collect        4096 Jul 29 15:52 scripts
    drwxr-s---   10 collect  nobody         4096 Jul 23 15:21 www
    [root@SAIX61SPTNIM] /home/secu # mv 'Start_Chk_Sec.sh' ./bin/Start_Chk_Sec.ksh
    mv: 0653-401 Cannot rename Start_Chk_Sec.sh to ./bin/Start_Chk_Sec.ksh:
                 A file or directory in the path name does not exist.
    
    [root@SAIX61SPTNIM] /home/secu # chmod 740 Start_Chk_Sec.sh
    chmod: Start_Chk_Sec.sh: A file or directory in the path name does not exist.
    [root@SAIX61SPTNIM] /home/secu # cat Start_Chk_Sec.sh
    cat: 0652-050 Cannot open Start_Chk_Sec.sh.
    [root@SAIX61SPTNIM] /home/secu # id
    uid=0(root) gid=0(system) groups=2(bin),3(sys),7(security),8(cron),10(audit),11(lp)
    [root@SAIX61SPTNIM] /home/secu # ll
    total 64
    -rw-r-----    1 collect  collect        1440 Jul 29 17:10 Start_Chk_Sec.sh
    drwx------    2 collect  collect         256 Jul 29 15:52 bin
    drwxrwx---    3 collect  collect        4096 Jul 29 15:40 listes
    drwx------    2 collect  collect         256 Jul 28 15:37 log
    drwx------    2 collect  collect        4096 Jul 29 17:06 motd
    drwx------    2 collect  collect        4096 Jul 28 15:07 ori
    drwx------    2 collect  collect        4096 Jul 29 10:29 out
    drwxr-xr-x    3 collect  collect        4096 Jul 29 09:38 reports
    drwx------    3 collect  collect        4096 Jul 29 15:52 scripts
    drwxr-s---   10 collect  nobody         4096 Jul 23 15:21 www
    [root@SAIX61SPTNIM] /home/secu # truss -eaf cat Start_Chk_Sec.sh
    7405606: execve("/usr/bin/cat", 0x2FF22CC8, 0x20012BE8)  argc: 2
    7405606: 11731177:  argv: cat Start_Chk_Sec.sh
    7405606: 11731177:  envp: _=/usr/bin/truss LANG=en_US LOGIN=root G_BROKEN_FILENAMES=1
    7405606: 11731177:  PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java5/jre/bin:/usr/java5/bin:/usr/local/bin:/usr/local/sbin
    7405606: 11731177:  LC__FASTMSG=true LOGNAME=root MAIL=/usr/spool/mail/root
    7405606: 11731177:  LOCPATH=/usr/lib/nls/loc PS1=[root@SAIX61SPTNIM] $PWD #  USER=root
    7405606: 11731177:  AUTHSTATE=files SHELL=/usr/bin/ksh ODMDIR=/etc/objrepos TMOUT=1800
    7405606: 11731177:  HOME=/root TERM=xterm MAILMSG=[YOU HAVE NEW MAIL]
    7405606: 11731177:  PWD=/home/secu TZ=Europe/Luxembourg A__z=! LOGNAME=#*TMOUT
    7405606: 11731177:  AIXTHREAD_SCOPE=S
    7405606: 11731177:  NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
    7405606: 11731177: sbrk(0x00000000)                     = 0x20002B7C
    7405606: 11731177: vmgetinfo(0x2FF21EC0, 7, 16)         = 0
    7405606: 11731177: sbrk(0x00000000)                     = 0x20002B7C
    7405606: 11731177: sbrk(0x00000004)                     = 0x20002B7C
    7405606: 11731177: __libc_sbrk(0x00000000)              = 0x20002B80
    7405606: 11731177: getuidx(4)                           = 0
    7405606: 11731177: getuidx(2)                           = 0
    7405606: 11731177: getuidx(1)                           = 0
    7405606: 11731177: getgidx(4)                           = 0
    7405606: 11731177: getgidx(2)                           = 0
    7405606: 11731177: getgidx(1)                           = 0
    7405606: 11731177: __loadx(0x01480080, 0x2FF21880, 0x00000A50, 0x2FF223F0, 0x00000000) = 0xD0525128
    7405606: 11731177: __loadx(0x01480180, 0x2FF21880, 0x00000A50, 0xF07F699C, 0xF07F68CC) = 0xF08C4DA0
    7405606: 11731177: __loadx(0x07080000, 0xF07F696C, 0xFFFFFFFF, 0xF08C4DA0, 0x00000000) = 0xF08C5CF4
    7405606: 11731177: __loadx(0x07080000, 0xF07F68AC, 0xFFFFFFFF, 0xF08C4DA0, 0x00000000) = 0xF08C5D00
    7405606: 11731177: __loadx(0x07080000, 0xF07F697C, 0xFFFFFFFF, 0xF08C4DA0, 0x00000000) = 0xF08C5D30
    7405606: 11731177: __loadx(0x07080000, 0xF07F68BC, 0xFFFFFFFF, 0xF08C4DA0, 0x00000000) = 0xF08C5D3C
    7405606: 11731177: __loadx(0x07080000, 0xF07F693C, 0xFFFFFFFF, 0xF08C4DA0, 0x00000000) = 0xF08C5D0C
    7405606: 11731177: __loadx(0x07080000, 0xF07F68DC, 0xFFFFFFFF, 0xF08C4DA0, 0x00000000) = 0xF08C5D24
    7405606: 11731177: __loadx(0x07080000, 0xF07F694C, 0xFFFFFFFF, 0xF08C4DA0, 0x00000000) = 0xF08C5D48
    7405606: 11731177: __loadx(0x07080000, 0xF07F695C, 0xFFFFFFFF, 0xF08C4DA0, 0x00000000) = 0xF08C5D78
    7405606: 11731177: __loadx(0x07080000, 0xF07F68EC, 0xFFFFFFFF, 0xF08C4DA0, 0x00000000) = 0xF08C5D60
    7405606: 11731177: __loadx(0x07080000, 0xF07F68FC, 0xFFFFFFFF, 0xF08C4DA0, 0x00000000) = 0xF08C5DD8
    7405606: 11731177: getuidx(4)                           = 0
    7405606: 11731177: getuidx(2)                           = 0
    7405606: 11731177: getuidx(1)                           = 0
    7405606: 11731177: getgidx(4)                           = 0
    7405606: 11731177: getgidx(2)                           = 0
    7405606: 11731177: getgidx(1)                           = 0
    7405606: 11731177: __loadx(0x01480080, 0x2FF21880, 0x00000A50, 0x2FF223F0, 0x00000000) = 0xD0525128
    7405606: 11731177: getuidx(4)                           = 0
    7405606: 11731177: getuidx(2)                           = 0
    7405606: 11731177: getuidx(1)                           = 0
    7405606: 11731177: getgidx(4)                           = 0
    7405606: 11731177: getgidx(2)                           = 0
    7405606: 11731177: getgidx(1)                           = 0
    7405606: 11731177: __loadx(0x01480080, 0x2FF21880, 0x00000A50, 0x2FF223F0, 0x00000000) = 0xD0525128
    7405606: 11731177: getuidx(4)                           = 0
    7405606: 11731177: getuidx(2)                           = 0
    7405606: 11731177: getuidx(1)                           = 0
    7405606: 11731177: getgidx(4)                           = 0
    7405606: 11731177: getgidx(2)                           = 0
    7405606: 11731177: getgidx(1)                           = 0
    7405606: 11731177: __loadx(0x01480080, 0x2FF21880, 0x00000A50, 0x2FF223F0, 0x00000000) = 0xD0525128
    7405606: 11731177: getuidx(4)                           = 0
    7405606: 11731177: getuidx(2)                           = 0
    7405606: 11731177: getuidx(1)                           = 0
    7405606: 11731177: getgidx(4)                           = 0
    7405606: 11731177: getgidx(2)                           = 0
    7405606: 11731177: getgidx(1)                           = 0
    7405606: 11731177: __loadx(0x01480080, 0x2FF21880, 0x00000A50, 0x2FF223F0, 0x00000000) = 0xD0525128
    7405606: 11731177: getuidx(4)                           = 0
    7405606: 11731177: getuidx(2)                           = 0
    7405606: 11731177: getuidx(1)                           = 0
    7405606: 11731177: getgidx(4)                           = 0
    7405606: 11731177: getgidx(2)                           = 0
    7405606: 11731177: getgidx(1)                           = 0
    7405606: 11731177: __loadx(0x01480080, 0x2FF21880, 0x00000A50, 0x2FF223F0, 0x00000000) = 0xD0525128
    7405606: 11731177: access("/usr/lib/nls/msg/en_US/cat.cat", 0) = 0
    7405606: 11731177: _getpid()                            = 7405606
    7405606: 11731177: fstatx(1, 0x2FF22AE8, 176, 020)      = 0
    7405606: 11731177: statx("Start_Chk_Sec.sh", 0x2FF22A38, 176, 020) Err#2  ENOENT
    7405606: 11731177: kopen("Start_Chk_Sec.sh", O_RDONLY|O_LARGEFILE) Err#2  ENOENT
    7405606: 11731177: kopen("/usr/lib/nls/msg/en_US/cat.cat", O_RDONLY) = 3
    7405606: 11731177: kioctl(3, 22528, 0x00000000, 0x00000000) Err#25 ENOTTY
    7405606: 11731177: kfcntl(3, F_SETFD, 0x00000001)       = 0
    7405606: 11731177: kioctl(3, 22528, 0x00000000, 0x00000000) Err#25 ENOTTY
    7405606: 11731177: kread(3, "\0\001 ¦\001\001 I S O 8".., 4096) = 522
    7405606: 11731177: lseek(3, 0, 1)                       = 522
    7405606: 11731177: lseek(3, 0, 1)                       = 522
    7405606: 11731177: lseek(3, 0, 1)                       = 522
    7405606: 11731177: _getpid()                            = 7405606
    7405606: 11731177: lseek(3, 0, 1)                       = 522
    cat: 0652-050 Cannot open 7405606: 11731177: kwrite(2, " c a t :   0 6 5 2 - 0 5".., 26) = 26
    Start_Chk_Sec.sh7405606: 11731177: kwrite(2, " S t a r t _ C h k _ S e".., 16) = 16
    .
    7405606: 11731177: kwrite(2, " .\n", 2)                 = 2
    7405606: 11731177: kfcntl(1, F_GETFL, 0x2FF22FFC)       = 67110914
    7405606: 11731177: close(1)                             = 0
    7405606: 11731177: kfcntl(2, F_GETFL, 0x2FF22FFC)       = 67110914
    7405606: 11731177: _exit(2)
    [root@SAIX61SPTNIM] /home/secu # set -o emacs
    [root@SAIX61SPTNIM] /home/secu # ls
    Start_Chk_Sec.sh        bin      listes   log      motd     ori      out      reports  scripts  www
    Petite aide ....

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    [root@SAIX61SPTNIM] /home/secu # cat *hk*
    #!/usr/bin/sh
    #@(#)###########################################################################################################
    #@(#)# Nom shell        : Start_Chk_Sec.sh
    #@(#)# Version          : 1.0
    #@(#)# Auteur           : x4983
    #@(#)# Date             : 29-06-2010
    #@(#)###########################################################################################################
    #@(#)# Modification             :
    #@(#)# 15-07-10 X4983   : Gestion d'exception par le fichier /home/secu/listes/Srv_Except.lst
    #@(#)# 27-07-10 X4983   :
    #@(#)###########################################################################################################
    #@(#)# Fonction         : Demarrage de la securite sur tous les serveurs identifie sous
    #@(#)# Fonction         : /home/secu/listes/Lst_Srv_Secu.txt
    #@(#)# Usage            : Start_Chk_Sec.sh
    #@(#)###########################################################################################################
    #
     [[ -n $DEBUG ]] && set -x
    #
    # DEFAULTS
    ##########

  2. #2
    Membre régulier
    Profil pro
    Inscrit en
    Juin 2009
    Messages
    70
    Détails du profil
    Informations personnelles :
    Âge : 54
    Localisation : France, Rhône (Rhône Alpes)

    Informations forums :
    Inscription : Juin 2009
    Messages : 70
    Points : 92
    Points
    92
    Par défaut Réponse
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    [root@SAIX61SPTNIM] /home/secu #] ls > toot
    [root@SAIX61SPTNIM] /home/secu # cat -tve toot
    Chk^H^H^H^[iStart_Chk_Seu^Hc.sh$
    bin$
    listes$
    log$
    motd$
    ori$
    out$
    reports$
    scripts$
    toot$
    www$
    [root@SAIX61SPTNIM] /home/secu # mv *hk* Start_Chk_Sec.sh
    [root@SAIX61SPTNIM] /home/secu # ls -l
    total 72
    -rw-r----- 1 collect collect 1440 Jul 29 17:10 Start_Chk_Sec.sh
    drwx------ 2 collect collect 256 Jul 29 15:52 bin
    drwxrwx--- 3 collect collect 4096 Jul 29 15:40 listes
    drwx------ 2 collect collect 256 Jul 28 15:37 log
    drwx------ 2 collect collect 4096 Jul 29 17:06 motd
    drwx------ 2 collect collect 4096 Jul 28 15:07 ori
    drwx------ 2 collect collect 4096 Jul 29 10:29 out
    drwxr-xr-x 3 collect collect 4096 Jul 29 09:38 reports
    drwx------ 3 collect collect 4096 Jul 29 15:52 scripts
    -rw-r----- 1 root system 80 Jul 30 09:10 toot
    drwxr-s--- 10 collect nobody 4096 Jul 23 15:21 www
    [root@SAIX61SPTNIM] /home/secu #cat Start_Chk_Sec.sh
    #!/usr/bin/sh
    #@(#)###########################################################################################################
    #@(#)# Nom shell : Start_Chk_Sec.sh
    #@(#)# Version : 1.0
    #@(#)# Auteur : x4983
    #@(#)# Date : 29-06-2010
    #@(#)###########################################################################################################
    #@(#)# Modification :
    #@(#)# 15-07-10 X4983 : Gestion d'exception par le fichier /home/secu/listes/Srv_Except.lst
    #@(#)# 27-07-10 X4983 :
    #@(#)###########################################################################################################
    #@(#)# Fonction : Demarrage de la securite sur tous les serveurs identifie sous
    #@(#)# Fonction : /home/secu/listes/Lst_Srv_Secu.txt
    #@(#)# Usage : Start_Chk_Sec.sh
    #@(#)###########################################################################################################
    #
    [[ -n $DEBUG ]] && set -x
    #
    # DEFAULTS
    ##########

  3. #3
    Modérateur
    Avatar de gangsoleil
    Homme Profil pro
    Manager / Cyber Sécurité
    Inscrit en
    Mai 2004
    Messages
    10 150
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Savoie (Rhône Alpes)

    Informations professionnelles :
    Activité : Manager / Cyber Sécurité

    Informations forums :
    Inscription : Mai 2004
    Messages : 10 150
    Points : 28 129
    Points
    28 129
    Par défaut
    Bonjour,

    La question est de savoir quel éditeur t'a autorisé a enregistrer un fichier nommé
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Chk^H^H^H^[iStart_Chk_Seu^Hc.sh$
    ?

  4. #4
    Membre confirmé
    Avatar de argoet
    Inscrit en
    Mai 2002
    Messages
    582
    Détails du profil
    Informations forums :
    Inscription : Mai 2002
    Messages : 582
    Points : 562
    Points
    562
    Par défaut
    Je viens de voir ce post et pour avoir été régulierement confronté à ce genre de chose : la réponse était evidente


    Un ([Ctrl]H aurait evité ce soucis

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Problème avec les fichiers DTD sous Eclipse
    Par samo73 dans le forum Eclipse
    Réponses: 1
    Dernier message: 22/09/2011, 11h45
  2. Problème avec la librairie rfunc sous Firebird
    Par yayelix dans le forum SQL
    Réponses: 4
    Dernier message: 17/05/2005, 16h49
  3. problème avec une page web sous firefox!
    Par 3psilOn dans le forum Balisage (X)HTML et validation W3C
    Réponses: 1
    Dernier message: 24/11/2004, 11h49
  4. Problème avec le port série sous Windows XP
    Par didou2dek dans le forum Composants VCL
    Réponses: 6
    Dernier message: 02/09/2003, 19h50
  5. Problème avec les fichiers .JPG
    Par cprogil dans le forum Langage
    Réponses: 5
    Dernier message: 10/06/2003, 15h44

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo