Bonjour,
Je souhaiterai formater le résultat d'une commande, ci-dessous un exemple de programme :
Code :
- desktop:/etc/X11$ CMDLINE='ls -al'
- desktop:/etc/X11$ RESULT=$($CMDLINE)
- desktop:/etc/X11$ echo -e "\t\t$RESULT\n"
- total 100
- drwxr-xr-x 10 root root 4096 2010-05-30 12:33 .
- drwxr-xr-x 128 root root 12288 2010-05-30 22:00 ..
- drwxr-xr-x 2 root root 4096 2010-04-29 14:27 app-defaults
- drwxr-xr-x 2 root root 4096 2010-04-29 14:27 cursors
- -rw-r--r-- 1 root root 14 2010-04-29 14:28 default-display-manager
- drwxr-xr-x 6 root root 4096 2010-04-29 14:25 fonts
- -rw-r--r-- 1 root root 17394 2009-12-03 11:56 rgb.txt
- lrwxrwxrwx 1 root root 13 2010-05-29 13:26 X -> /usr/bin/Xorg
- drwxr-xr-x 3 root root 4096 2010-04-29 14:27 xinit
- drwxr-xr-x 2 root root 4096 2010-04-15 14:12 xkb
- -rw-r--r-- 1 root root 2614 2010-05-30 12:33 xorg.conf
- -rw-r--r-- 1 root root 2573 2010-05-30 10:34 xorg.conf-backup-100530103356
- -rw-r--r-- 1 root root 269 2010-05-30 10:33 xorg.conf.failsafe
- -rwxr-xr-x 1 root root 709 2010-04-01 13:19 Xreset
- drwxr-xr-x 2 root root 4096 2010-04-29 14:20 Xreset.d
- drwxr-xr-x 2 root root 4096 2010-04-29 14:20 Xresources
- -rwxr-xr-x 1 root root 3730 2010-04-01 13:07 Xsession
- drwxr-xr-x 2 root root 4096 2010-05-30 12:38 Xsession.d
- -rw-r--r-- 1 root root 265 2008-07-01 19:41 Xsession.options
- -rw------- 1 root root 601 2010-04-29 14:20 Xwrapper.config
|
En gros, le résultat que j'attend, c'est que toutes les lignes subissent une double tabulation.
Comment faire sans passer par un fichier ?
Merci d'avance de votre retour.
Message édité par lebarjoe le 01-06-2010 à 09:06:21