What is the use of declare with option -tIn Bash, when to alias, when to script, and when to write a...
Entered UK using my now-lost UK passport; can I go to Spain using my US passport?
What is the STRONGEST end-of-line knot to use if you want to use a steel-thimble at the end, so that you've got a steel-eyelet at the end of the line?
That's not my X, its Y is too Z
How many sets of dice do I need for D&D?
If absolute velocity does not exist, how can we say a rocket accelerates in empty space?
Problem with pronounciation
How can powerful telekinesis avoid violating Newton's 3rd Law?
Professor Roman loves to teach unorthodox Chemistry
In American Politics, why is the Justice Department under the President?
How to create two-week recurring alarms and reminders?
Should I explain the reasons for gaslighting?
When to use и or а as “and”?
Why do I seem to lose data using this bash pipe construction?
My mom's return ticket is 3 days after I-94 expires
Why is my power MOSFET heating up when on?
How do I type a hyphen in iOS 12?
Create a cube from identical 3D objects
DateTime.addMonths skips a month (from feb to mar)
Is all-caps blackletter no longer taboo?
What's the difference between DHCP and NAT? Are they mutually exclusive?
Savage Road Signs
Why did Robert pick unworthy men for the White Cloaks?
How to use the word seem
Was planting UN flag on Moon ever discussed?
What is the use of declare with option -t
In Bash, when to alias, when to script, and when to write a function?Bash source — select the right function when two sourced files have the same function name?bash equivalent of zsh's $@[2,$#]How do I suppress stderr warning messages from a command inside command substitution?How to remove the functions displayed by set command?bash vs zsh: scoping and `typeset -g`How to automatically insert a string after the promptdeclare: -A: invalid optionBash script to find and change file extensions recursivelyHow to make my bash function known to external program
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
If you call the command help declare
. You will see the following information:
-t NAME : to make NAMEs have the `trace' attribute
Is there any example that demonstrates the use of this option. I thought that this plays the same role as that of the command set -o functrace
except that it only applies to the arguments instead of all fucntions.
The motivation of this question is that I want a function foo to interits a trap. So I tried tried decalre -t foo
but it did not work.
I can certainly use set -o functrace
to make all functions to inherrit a trap, but there are circumstances when I want only one or two functions to inherit a trap.
bash shell-script
add a comment |
If you call the command help declare
. You will see the following information:
-t NAME : to make NAMEs have the `trace' attribute
Is there any example that demonstrates the use of this option. I thought that this plays the same role as that of the command set -o functrace
except that it only applies to the arguments instead of all fucntions.
The motivation of this question is that I want a function foo to interits a trap. So I tried tried decalre -t foo
but it did not work.
I can certainly use set -o functrace
to make all functions to inherrit a trap, but there are circumstances when I want only one or two functions to inherit a trap.
bash shell-script
add a comment |
If you call the command help declare
. You will see the following information:
-t NAME : to make NAMEs have the `trace' attribute
Is there any example that demonstrates the use of this option. I thought that this plays the same role as that of the command set -o functrace
except that it only applies to the arguments instead of all fucntions.
The motivation of this question is that I want a function foo to interits a trap. So I tried tried decalre -t foo
but it did not work.
I can certainly use set -o functrace
to make all functions to inherrit a trap, but there are circumstances when I want only one or two functions to inherit a trap.
bash shell-script
If you call the command help declare
. You will see the following information:
-t NAME : to make NAMEs have the `trace' attribute
Is there any example that demonstrates the use of this option. I thought that this plays the same role as that of the command set -o functrace
except that it only applies to the arguments instead of all fucntions.
The motivation of this question is that I want a function foo to interits a trap. So I tried tried decalre -t foo
but it did not work.
I can certainly use set -o functrace
to make all functions to inherrit a trap, but there are circumstances when I want only one or two functions to inherit a trap.
bash shell-script
bash shell-script
asked 11 mins ago
Jack ChenJack Chen
384
384
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f524132%2fwhat-is-the-use-of-declare-with-option-t%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f524132%2fwhat-is-the-use-of-declare-with-option-t%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown