Skip to main content
Have another shell.
Source Link
JdeBP
  • 72k
  • 13
  • 175
  • 378

In Bash and the Z shell, at least, there is a faster way:

CONFIG_DATA=$(<config) 

To quote from the Bourne Again shell's man page:

The command substitution $(cat file) can be replaced by the equivalent but faster $(< file).

In Bash, at least, there is a faster way:

CONFIG_DATA=$(<config) 

To quote from the man page:

The command substitution $(cat file) can be replaced by the equivalent but faster $(< file).

In Bash and the Z shell, at least, there is a faster way:

CONFIG_DATA=$(<config) 

To quote from the Bourne Again shell's man page:

The command substitution $(cat file) can be replaced by the equivalent but faster $(< file).

added 168 characters in body
Source Link
Wildcard
  • 37.5k
  • 30
  • 149
  • 284

try this.....In Bash, at least, there is a faster way:

CONFIG_DATA=$(<config) 

To quote from the man page:

The command substitution $(cat file) can be replaced by the equivalent but faster $(< file).

try this.....

CONFIG_DATA=$(<config) 

In Bash, at least, there is a faster way:

CONFIG_DATA=$(<config) 

To quote from the man page:

The command substitution $(cat file) can be replaced by the equivalent but faster $(< file).

Source Link
Kamaraj
  • 4.4k
  • 1
  • 15
  • 19

try this.....

CONFIG_DATA=$(<config)