Skip to main content
added 6 characters in body
Source Link
ilkkachu
  • 141.4k
  • 16
  • 249
  • 418

I have been teaching myself the meaning of various bash 'reserved words'.

In doing this, I inadvertently typed the command

echo !()

To my surprise, this command executes, and produces output identical to the command

echo *

In other words, the output was a list of the contents of the current directory

file1 file2 directory1 directory2

Why is bash essentially expanding !()!() to * * ?

I can't determine the meaning of ()(), as it seems to be an invalid expression in other contexts.

I have been teaching myself the meaning of various bash 'reserved words'.

In doing this, I inadvertently typed the command

echo !()

To my surprise, this command executes, and produces output identical to the command

echo *

In other words, the output was a list of the contents of the current directory

file1 file2 directory1 directory2

Why is bash essentially expanding !() to * ?

I can't determine the meaning of (), as it seems to be an invalid expression in other contexts.

I have been teaching myself the meaning of various bash 'reserved words'.

In doing this, I inadvertently typed the command

echo !()

To my surprise, this command executes, and produces output identical to the command

echo *

In other words, the output was a list of the contents of the current directory

file1 file2 directory1 directory2

Why is bash essentially expanding !() to * ?

I can't determine the meaning of (), as it seems to be an invalid expression in other contexts.

Became Hot Network Question
added 5 characters in body
Source Link
jrt
  • 213
  • 1
  • 7

I have been teaching myself the meaning of various bash 'reserved words'.

In doing this, I inadvertently typed the command

echo !()

To my surprise, this command executes, and produces output identical to the command

echo *

In other words, the output was a list of the contents of the current directory

file1 file2 directory1 directory2

Why is bash essentially expanding !() to * ? 

I can't determine the meaning of (), as it seems to be an invalid expression in other contexts.

I have been teaching myself the meaning of various bash 'reserved words'.

In doing this, I inadvertently typed the command

echo !()

To my surprise, this command executes, and produces output identical to the command

echo *

In other words, the output was a list of the contents of the current directory

file1 file2 directory1 directory2

Why is bash essentially expanding !() to * ? I can't determine the meaning of (), as it seems to be an invalid expression in other contexts.

I have been teaching myself the meaning of various bash 'reserved words'.

In doing this, I inadvertently typed the command

echo !()

To my surprise, this command executes, and produces output identical to the command

echo *

In other words, the output was a list of the contents of the current directory

file1 file2 directory1 directory2

Why is bash essentially expanding !() to * ? 

I can't determine the meaning of (), as it seems to be an invalid expression in other contexts.

Source Link
jrt
  • 213
  • 1
  • 7

Why does echo !() print the contents of the current directory?

I have been teaching myself the meaning of various bash 'reserved words'.

In doing this, I inadvertently typed the command

echo !()

To my surprise, this command executes, and produces output identical to the command

echo *

In other words, the output was a list of the contents of the current directory

file1 file2 directory1 directory2

Why is bash essentially expanding !() to * ? I can't determine the meaning of (), as it seems to be an invalid expression in other contexts.