Skip to main content

"Are there other commands which prints only the shell variables, without the functions?"

In man bash, in section SHELL BUILTIN COMMANDS (in the set section) it says: "In posix mode, only shell variables are listed."

(set -o posix; set)

note: () syntax spawns a subshell, if you don't like forking just use the more verbose version

set -o posix; set; set +o posix

"Are there other commands which prints only the shell variables, without the functions?"

In man bash, in section SHELL BUILTIN COMMANDS (in the set section) it says: "In posix mode, only shell variables are listed."

(set -o posix; set)

"Are there other commands which prints only the shell variables, without the functions?"

In man bash, in section SHELL BUILTIN COMMANDS (in the set section) it says: "In posix mode, only shell variables are listed."

(set -o posix; set)

note: () syntax spawns a subshell, if you don't like forking just use the more verbose version

set -o posix; set; set +o posix
deleted 106 characters in body
Source Link
Lesmana
  • 28.1k
  • 20
  • 85
  • 87

"Are there other commands which prints only the shell variables, without the functions?"

In man bash, in section SHELL BUILTIN COMMANDS (in the set section) it says: "In posix mode, only shell variables are listed."

(set -o posix; set)

I know that the question has been answered but (set -o posix; set) is cleaner than most suggestions.

"Are there other commands which prints only the shell variables, without the functions?"

In man bash, in section SHELL BUILTIN COMMANDS (in the set section) it says: "In posix mode, only shell variables are listed."

(set -o posix; set)

I know that the question has been answered but (set -o posix; set) is cleaner than most suggestions.

"Are there other commands which prints only the shell variables, without the functions?"

In man bash, in section SHELL BUILTIN COMMANDS (in the set section) it says: "In posix mode, only shell variables are listed."

(set -o posix; set)
edited body
Source Link
temp
  • 744
  • 6
  • 3

"Are there other commands which prints only the shell variables, without the functions?"

In man bash, in section SHELL BUILTIN COMMANDS (in the set section) it says: "In posix mode, only shell variables are listed."

(set -o posix; set)

I know that the question has been answered but (set -o posix; set) is cleaner thenthan most suggestions.

"Are there other commands which prints only the shell variables, without the functions?"

In man bash, in section SHELL BUILTIN COMMANDS (in the set section) it says: "In posix mode, only shell variables are listed."

(set -o posix; set)

I know that the question has been answered but (set -o posix; set) is cleaner then most suggestions.

"Are there other commands which prints only the shell variables, without the functions?"

In man bash, in section SHELL BUILTIN COMMANDS (in the set section) it says: "In posix mode, only shell variables are listed."

(set -o posix; set)

I know that the question has been answered but (set -o posix; set) is cleaner than most suggestions.

added 6 characters in body
Source Link
Anthon
  • 81.4k
  • 42
  • 174
  • 228
Loading
Source Link
temp
  • 744
  • 6
  • 3
Loading