Zsh function does not terminate when ${name:?word} fails
(Simplified example):
I have in my .zshrc the following function definition:
Running the function with just foo produces, as expected, the message parameter missing, but it also output continue. I had expected that the function terminates, when the :? check fails, but it continues to run. Why is this the case?
The man-page zshexpn says:
... otherwise, print word and exit from the shell. Interactive shells instead return to the prompt.
ADDITIONAL FINDINGS:
I found that this behaviour depends on the presence of the local command. If I remove local, the function works as expected. Since I need local, I can rewrite the function like this:
This works fine, but I still am curious to know, why the presence of local causes this difference in behaviour.
Hello everyone,
I am having problems figuring this out.
This script below is supposed to create a list of file names with their "md5sum", in a file "lib-list.txt"
When I run it "sh component-list.sh " I get this:component-list.sh: 4: component-list.sh: function: not found
component-list.sh:... (4 Replies)
Sorry for my english
Hello all my friends and seniors, i had created a programm in c++
(anagrammig of word) it works fine but i cannot understand how exactly
recursion is working , i mean oh.. first look at the code .
#include <iostream>
#include <string>
... (1 Reply)
I have a file that has the words I want to find in other files (but lets say I just want to find my words in a single file). Those words are IDs, so if my word is ZZZ4, outputs like aaZZZ4, ZZZ4bb, aaZZZ4bb, ZZ4, ZZZ, ZyZ4, ZZZ4.8 (or anything like that) WON'T BE USEFUL.
I need the whole word... (6 Replies)
Hi All,
I want to find out function name based on word.
Here i ll give u one example
I have several files based on below format. file will start and ends with same name only
EX: file1.txt
public function calculate1()
{
----
----
call Global Function1()
----
----
} END... (9 Replies)
I am having a strange problem with the poll() routine. I compiled a module under AIX 5.2 using the poll routine, it worked fine. When the OS was upgraded to AIX 5.3 the poll routine return an error code.
Here is a summary of the code:
#define MAX_EVENTS 300
long eventCount;... (0 Replies)
We have a system user "oracle_usr" always run some process in the system , but sometimes , these processes will not stop automatically until we terminate the process , can suggest the method how to terminate the process that is run by "oracle_usr" and run over 10 minutes ? thx (5 Replies)
I want to have a script to terminate the system process that generated by user oracle_usr and have already processed for over 10 minutes , could suggest the script ? thx (1 Reply)
In my system , there are a system user "cronusr" , it is mainly to run the crontab job in the database .Sometimes the cronjob process will be failure ( due to some reason ) so that many cronusr process are in the system , it affect other process in the system ,
I want to have a script that can... (2 Replies)