bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bash command alias has a problem in using brace.


From: Hyunho Cho
Subject: bash command alias has a problem in using brace.
Date: Fri, 27 Aug 2021 18:10:42 +0900

Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2 -flto=auto -ffat-lto-objects
-fstack-protector-strong -Wformat -Werror=format-security -Wall
uname output: Linux EliteBook 5.11.0-25-generic #27-Ubuntu SMP Fri Jul
9 23:06:29 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 5.1
Patch Level: 4
Release Status: release

###################################################################################

If i enter a command line like below then '>' prompt appears for the
input of here document.

bash$ { cat <<\@ > foo ;} 2> /dev/null
> 111
> 222                      # '>' prompt
> @


but if i use alias then '>' prompt does not appear and default bash
prompt appears

bash$ alias myalias='{ cat <<\@ > foo ;} 2> /dev/null'
bash$ myalias
bash$ 111
bash$ 222              # bash$ prompt
bash$ @


this only occurs in brace

bash$ alias myalias='( cat <<\@ > foo ) 2> /dev/null'
bash$ myalias
> 111
> 222                   # '>' prompt
> @



reply via email to

[Prev in Thread] Current Thread [Next in Thread]