[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
exec status with no command is 0 but no redirection
From: |
fpo |
Subject: |
exec status with no command is 0 but no redirection |
Date: |
Fri, 14 May 2010 10:37:30 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); fr; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 |
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu'
-DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/local/share/locale'
-DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include
-I./lib -g -O2
uname output: Linux pc9 2.6.31.13-desktop-1mnb #1 SMP Tue Apr 27
20:37:44 EDT 2010 x86_64 Intel(R) Core(TM)2 Duo CPU E8500 @ 3.16GHz
GNU/Linux
Machine Type: x86_64-unknown-linux-gnu
Bash Version: 4.1
Patch Level: 0
Release Status: release
Description:
Well, I am not sure it is a bug. I just tried this after reading the
manual page and the exec built-in command. I was expecting to have the
iconv command be called on the standard output of the shell script.
The script below outputs 0 as exec return status and the string is yet
given as ISO-8859-1. One of these is probably not correct though, shall
we expect a status = 1 if no redirection is done?
Repeat-By:
A simple script, that should be saved in ISO-8859-1 encoding system:
#!/bin/bash
exec | iconv -f ISO_8859-1 -t UTF-8
echo exec status $?
echo " 15) Valérie Leulliot - Mon homme blessé "
exit 0
Thanks a lot and regards.
- fpo
- exec status with no command is 0 but no redirection,
fpo <=