bash function without argumentsbash: [: too many arguments?Change Gsetting with script on...

Is there a lava-breathing lizard creature (that could be worshipped by a cult) in 5e?

Why is Agricola named as such?

Why didn't Tom Riddle take the presence of Fawkes and the Sorting Hat as more of a threat?

How to assess the long-term stability of a college as part of a job search

Can I announce prefix 161.117.25.0/24 even though I don't have all of /24 IPs?

Why avoid shared user accounts?

Saint abbreviation

Limits of a density function

After checking in online, how do I know whether I need to go show my passport at airport check-in?

Has any human ever had the choice to leave Earth permanently?

Is there any risk in sharing info about technologies and products we use with a supplier?

Why did Democrats in the Senate oppose the Born-Alive Abortion Survivors Protection Act (2019 S.130)?

Eww, those bytes are gross

How would an AI self awareness kill switch work?

Why did Luke use his left hand to shoot?

How do you voice extended chords?

Custom color for fence, whisker and outliers in BoxWhiskerChart

Is a new boolean field better than null reference when a value can be meaningfully absent?

Is this ordinary workplace experiences for a job in Software Engineering?

How can the probability of a fumble decrease linearly with more dice?

Separate environment for personal and development use under macOS

Bash script to truncate subject line of incoming email

How much mayhem could I cause as a fish?

Building an exterior wall within an exterior wall for insulation



bash function without arguments


bash: [: too many arguments?Change Gsetting with script on Logoutalias/function with command line argumentsEcho script arguments from functionBash Function Oblivionhow to fix my keyboard after a bash script messed it upprocessing arguments with bash functionBash Command Arguments ${…}Bash randomization function errorHow to pass arguments from one function to another function in bash scripting?













0















I am analyzing the following script (init script for ptpd2 deamon):



#!/bin/sh
#
# Start ptpd2
#

case "$1" in
start)
printf "Starting ptpd2: "
start-stop-daemon -S -q -x /usr/sbin/ptpd2 -- -g -i eth0 -s
if [ $? != 0 ]; then
echo "FAILED"
exit 1
else
echo "OK"
fi
;;
stop)
printf "Stopping ptpd2: "
start-stop-daemon -K -q -x /usr/sbin/ptpd2
echo "OK"
;;
restart|reload)
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac

exit $?


What does start), stop) mean? What kind of constraction is this? A function without arguments maybe?









share























  • part of the case structure, started with case and ending at the esac (case backwards) line. It controls execution by the "$1" ...

    – guiverc
    38 secs ago
















0















I am analyzing the following script (init script for ptpd2 deamon):



#!/bin/sh
#
# Start ptpd2
#

case "$1" in
start)
printf "Starting ptpd2: "
start-stop-daemon -S -q -x /usr/sbin/ptpd2 -- -g -i eth0 -s
if [ $? != 0 ]; then
echo "FAILED"
exit 1
else
echo "OK"
fi
;;
stop)
printf "Stopping ptpd2: "
start-stop-daemon -K -q -x /usr/sbin/ptpd2
echo "OK"
;;
restart|reload)
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac

exit $?


What does start), stop) mean? What kind of constraction is this? A function without arguments maybe?









share























  • part of the case structure, started with case and ending at the esac (case backwards) line. It controls execution by the "$1" ...

    – guiverc
    38 secs ago














0












0








0








I am analyzing the following script (init script for ptpd2 deamon):



#!/bin/sh
#
# Start ptpd2
#

case "$1" in
start)
printf "Starting ptpd2: "
start-stop-daemon -S -q -x /usr/sbin/ptpd2 -- -g -i eth0 -s
if [ $? != 0 ]; then
echo "FAILED"
exit 1
else
echo "OK"
fi
;;
stop)
printf "Stopping ptpd2: "
start-stop-daemon -K -q -x /usr/sbin/ptpd2
echo "OK"
;;
restart|reload)
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac

exit $?


What does start), stop) mean? What kind of constraction is this? A function without arguments maybe?









share














I am analyzing the following script (init script for ptpd2 deamon):



#!/bin/sh
#
# Start ptpd2
#

case "$1" in
start)
printf "Starting ptpd2: "
start-stop-daemon -S -q -x /usr/sbin/ptpd2 -- -g -i eth0 -s
if [ $? != 0 ]; then
echo "FAILED"
exit 1
else
echo "OK"
fi
;;
stop)
printf "Stopping ptpd2: "
start-stop-daemon -K -q -x /usr/sbin/ptpd2
echo "OK"
;;
restart|reload)
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac

exit $?


What does start), stop) mean? What kind of constraction is this? A function without arguments maybe?







bash





share












share










share



share










asked 3 mins ago









AndyAndy

11




11













  • part of the case structure, started with case and ending at the esac (case backwards) line. It controls execution by the "$1" ...

    – guiverc
    38 secs ago



















  • part of the case structure, started with case and ending at the esac (case backwards) line. It controls execution by the "$1" ...

    – guiverc
    38 secs ago

















part of the case structure, started with case and ending at the esac (case backwards) line. It controls execution by the "$1" ...

– guiverc
38 secs ago





part of the case structure, started with case and ending at the esac (case backwards) line. It controls execution by the "$1" ...

– guiverc
38 secs ago










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2faskubuntu.com%2fquestions%2f1121612%2fbash-function-without-arguments%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 Ask Ubuntu!


  • 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%2faskubuntu.com%2fquestions%2f1121612%2fbash-function-without-arguments%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

Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

Simple Scan not detecting my scanner (Brother DCP-7055W)Brother MFC-L2700DW printer can print, can't...