Unix check string null




















The -z operator functions similarly like -n operator. Below is an example:. Most importantly, you should add spaces around the square brackets. If there are no spaces, bash will complain about that. Today's Posts. Quick Links. Search Forums. Show Threads. Show Posts. Shell Programming and Scripting. How to check for null or empty string.

Registered User. Join Date: Jul Please modify this script Code :. Last edited by Yogesh Sawant; at AM.. Reason: added code tags. Join Date: Dec Please read our rules and refrain from bumping your posts.

Thanks, ZB. Originally Posted by zazzybob. You shuld post the solution to help other forum members having same type of problems in coming future Cheers, Awadhesh. Originally Posted by doer. Code :. Parsing null or empty output. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Checking for null string in bash Ask Question.

Asked 10 years, 6 months ago. Active 10 years, 6 months ago. Viewed 7k times. Is there any difference between the following tests? Add a comment. Active Oldest Votes.



0コメント

  • 1000 / 1000