Is there a way to prevent obfuscated shell-script to be $(echo)ed?Bash script strange behavior with echo -...

Non-OR journals which regularly publish OR research

Plausibility of Ice Eaters in the Arctic

Word or idiom defining something barely functional

Why should we care about syntactic proofs if we can show semantically that statements are true?

Author changing name

Dropdowns & Chevrons for Right to Left languages

In a topological space if there exists a loop that cannot be contracted to a point does there exist a simple loop that cannot be contracted also?

Acceptable to cut steak before searing?

Why do oscilloscopes use SMPS instead of linear power supply?

In Pokémon Go, why does one of my Pikachu have an option to evolve, but another one doesn't?

Best gun to modify into a monsterhunter weapon?

How to mark beverage cans in a cooler for a blind person?

What are the uses and limitations of Persuasion, Insight, and Deception against other PCs?

Generator for parity?

Why did the RAAF procure the F/A-18 despite being purpose-built for carriers?

Double blind peer review when paper cites author's GitHub repo for code

How quickly could a country build a tall concrete wall around a city?

Can I legally make a real mobile app based on a fictional app from a TV show?

Unique combinations of a list of tuples

show stdout containing n with line breaks

Are there any financial disadvantages to living significantly "below your means"?

Buffering in WGS 84 / Pseudo-Mercator 3857 using QGIS?

Could one become a successful researcher by writing some really good papers while being outside academia?

Blocking people from taking pictures of me with smartphone



Is there a way to prevent obfuscated shell-script to be $(echo)ed?


Bash script strange behavior with echo - printf in a filehow to evaluate an dynamically generated if elif else statement in shellAppend a file or command at the end of the line of another filePrint variable inside looprunning remote bash script from local linux host and issue with "echo command not workingEcho Permission Denied (Trying to use echo instead of ls command in shell script)korn shell - if a variable exists in an array stop processing without exiting






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















Tried using



CTR=$(cat "$0" | sed -n '3,999999999p' | grep -Eo "(printf|echo|cat)")  
if [[ "$CTR" = *printf* ]]; then exit; elif [[ "$CTR" = *echo* ]]; then exit; elif [[ "$CTR" = *cat* ]]; then exit; else :; fi


But it'll be useless if someone deleted the $CTR










share|improve this question



























  • Obfuscation of shell scripts is usually a waste of time (although some people will tell you that all scripts are obfuscated from the start). Running the script under -x will show the commands one at a time. What are you hoping to achieve? In your script you could replace sed -n '3,999999999p' with sed '1,2d' which better reflects your desire to delete the first two lines. cat "$0" | will get you a useless use of cat award. The grep can be folded into the sed as well.

    – icarus
    11 mins ago


















0















Tried using



CTR=$(cat "$0" | sed -n '3,999999999p' | grep -Eo "(printf|echo|cat)")  
if [[ "$CTR" = *printf* ]]; then exit; elif [[ "$CTR" = *echo* ]]; then exit; elif [[ "$CTR" = *cat* ]]; then exit; else :; fi


But it'll be useless if someone deleted the $CTR










share|improve this question



























  • Obfuscation of shell scripts is usually a waste of time (although some people will tell you that all scripts are obfuscated from the start). Running the script under -x will show the commands one at a time. What are you hoping to achieve? In your script you could replace sed -n '3,999999999p' with sed '1,2d' which better reflects your desire to delete the first two lines. cat "$0" | will get you a useless use of cat award. The grep can be folded into the sed as well.

    – icarus
    11 mins ago














0












0








0








Tried using



CTR=$(cat "$0" | sed -n '3,999999999p' | grep -Eo "(printf|echo|cat)")  
if [[ "$CTR" = *printf* ]]; then exit; elif [[ "$CTR" = *echo* ]]; then exit; elif [[ "$CTR" = *cat* ]]; then exit; else :; fi


But it'll be useless if someone deleted the $CTR










share|improve this question
















Tried using



CTR=$(cat "$0" | sed -n '3,999999999p' | grep -Eo "(printf|echo|cat)")  
if [[ "$CTR" = *printf* ]]; then exit; elif [[ "$CTR" = *echo* ]]; then exit; elif [[ "$CTR" = *cat* ]]; then exit; else :; fi


But it'll be useless if someone deleted the $CTR







shell-script






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 42 mins ago







IISomeOneII

















asked 48 mins ago









IISomeOneIIIISomeOneII

1141 silver badge12 bronze badges




1141 silver badge12 bronze badges
















  • Obfuscation of shell scripts is usually a waste of time (although some people will tell you that all scripts are obfuscated from the start). Running the script under -x will show the commands one at a time. What are you hoping to achieve? In your script you could replace sed -n '3,999999999p' with sed '1,2d' which better reflects your desire to delete the first two lines. cat "$0" | will get you a useless use of cat award. The grep can be folded into the sed as well.

    – icarus
    11 mins ago



















  • Obfuscation of shell scripts is usually a waste of time (although some people will tell you that all scripts are obfuscated from the start). Running the script under -x will show the commands one at a time. What are you hoping to achieve? In your script you could replace sed -n '3,999999999p' with sed '1,2d' which better reflects your desire to delete the first two lines. cat "$0" | will get you a useless use of cat award. The grep can be folded into the sed as well.

    – icarus
    11 mins ago

















Obfuscation of shell scripts is usually a waste of time (although some people will tell you that all scripts are obfuscated from the start). Running the script under -x will show the commands one at a time. What are you hoping to achieve? In your script you could replace sed -n '3,999999999p' with sed '1,2d' which better reflects your desire to delete the first two lines. cat "$0" | will get you a useless use of cat award. The grep can be folded into the sed as well.

– icarus
11 mins ago





Obfuscation of shell scripts is usually a waste of time (although some people will tell you that all scripts are obfuscated from the start). Running the script under -x will show the commands one at a time. What are you hoping to achieve? In your script you could replace sed -n '3,999999999p' with sed '1,2d' which better reflects your desire to delete the first two lines. cat "$0" | will get you a useless use of cat award. The grep can be folded into the sed as well.

– icarus
11 mins ago










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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f534958%2fis-there-a-way-to-prevent-obfuscated-shell-script-to-be-echoed%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
















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f534958%2fis-there-a-way-to-prevent-obfuscated-shell-script-to-be-echoed%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...