Uilise vi dans shell
Résolu
Bonjour,
je voudrais realise dans script shell test.sh qui contient vi mais quand j'execute il affiche une page vide
voila mon script
#!bin/bash
vi /home/test/.procmailrc
SHELL=/bin/sh
PATH=/usr/bin
DEFAULT=/home/essai/mail/ #repertoire pa defaut ou sont stockes les mails
MAILDIR=/home/essai/
LOGFILE=$MAILDIR/.procmail.log
INCLUDEDIR=/home/essai/.procmailrc
MAILCOPY=/home/essai/copymail/
:0c:
* ^From.*fai@hotmail.com
$MAILCOPY
:wq
je voudrais realise dans script shell test.sh qui contient vi mais quand j'execute il affiche une page vide
voila mon script
#!bin/bash
vi /home/test/.procmailrc
SHELL=/bin/sh
PATH=/usr/bin
DEFAULT=/home/essai/mail/ #repertoire pa defaut ou sont stockes les mails
MAILDIR=/home/essai/
LOGFILE=$MAILDIR/.procmail.log
INCLUDEDIR=/home/essai/.procmailrc
MAILCOPY=/home/essai/copymail/
:0c:
* ^From.*fai@hotmail.com
$MAILCOPY
:wq
A voir également:
- Uilise vi dans shell
- Classic shell - Télécharger - Personnalisation
- Ssh secure shell download - Télécharger - Divers Web & Internet
- Shell startup windows 10 - Guide
- Shell infrastructure host c'est quoi - Guide
- Shell do while ✓ - Forum Shell
1 réponse
Quel est le but du script ? Si c'est écrire dans /home/test/.procmailrc il vaudrait mieux faire des echos.
En vim tu peux scripter des commandes vim (cf par exemple /etc/vim/vimrc) mais a priori ce n'est pas fait pour écrire du texte dans un fichier.
Bonne chance
#!/bin/sh echo "plop !" > pouet.txt echo "plop !!" >> pouet.txt echo "plop !!!" >> pouet.txt
En vim tu peux scripter des commandes vim (cf par exemple /etc/vim/vimrc) mais a priori ce n'est pas fait pour écrire du texte dans un fichier.
Bonne chance