Sponsored Content
Full Discussion: Cannot exit from a function?
Top Forums UNIX for Advanced & Expert Users Cannot exit from a function? Post 302546210 by Corona688 on Wednesday 10th of August 2011 04:23:52 PM
Old 08-10-2011
That is a wasted fork.

There's a special syntax for exiting from a subroutine, called return. It works like exit, it can take a value, but it doesn't end the script.

return is also used to exit from a sourced script.
 

10 More Discussions You Might Find Interesting

1. Programming

How to get exit value of an executable that gets called from function?

How to get exit value of an executable that gets called from function? I have an executable called “myexec” which returns 0 on success and different values for different fail scenarios. I need to call this (myexec) executable from “myprog()” function of other executable and get the exit value... (1 Reply)
Discussion started by: sureshreddi_ps
1 Replies

2. Shell Programming and Scripting

exit shell script from function

Hi all, I have tried to put a exit 0 statement within a function I have created in the shell script but it doesn't seem to exit out of the script? Can someone tell me why? And is there any other way to exit out of the script from within a function? Thanks! (1 Reply)
Discussion started by: nvrh7
1 Replies

3. UNIX for Dummies Questions & Answers

EXIT from a Program not from the function..

Hi, I want a command in unix shell script which will exit my whole program, not only from the function it's using. For e.g: $1 == "m_who" && $4 == "Extrnl Vendor" { print "You don have access" exit (0); } If this error is showing on the screen, then nothing should not... (9 Replies)
Discussion started by: ronix007
9 Replies

4. Programming

capturing enter and exit of every function

If I have a "Hello World" function (just prints that) and a similar "Goodbye World" function... is there a way (maybe a compiler option?) that I can get them to be executed directly as the absolute first and last things run in every function call. So for example, the following code: int foo()... (5 Replies)
Discussion started by: jjinno
5 Replies

5. Shell Programming and Scripting

exit from function

Hi all, My kshell code is not working, when I use a function to return something. But when I use the same function as without returning any values, it is working. Pls help me here. Code1 : func1 () { y=`echo $x | grep XXX| cut -f 2 -d ' '` if ; then exit 100 ... (2 Replies)
Discussion started by: poova
2 Replies

6. Shell Programming and Scripting

Exit from function

Hi, I just want to exit from function if some condition doesnt meet then control should go back to main program and start running from where it left.. When i used "exit" inside the function, its simply exited from entire script and it didnt run anymore.. Any idea how to do this.. Thanks... (3 Replies)
Discussion started by: nram_krishna@ya
3 Replies

7. Shell Programming and Scripting

After exit from function it should not call other function

Below is my script that is function properly per my conditions but I am facing one problem here that is when one function fails then Iy should not check other functions but it calls the other function too So anyone can help me how could i achieve this? iNOUT i AM GIVING TO THE... (1 Reply)
Discussion started by: rohit22hamirpur
1 Replies

8. Shell Programming and Scripting

Replacement of exit function

I am reading multiple numbers from user and getting its respective string value from the One.txt.But while putting this text value to the two.txt file , i want to check that if this string already there in the file , if the string already exists in the two.txt file .....the string will be ignored.... (1 Reply)
Discussion started by: jalpasoni
1 Replies

9. Programming

exit function doubts

At many places in program I see exit() being called with 2 passed as parameter to it. exit(2); What does this 2 stands for? Can I get a list all such parameters to exit? (6 Replies)
Discussion started by: rupeshkp728
6 Replies

10. Shell Programming and Scripting

Function - Make your function return an exit status

Hi All, Good Day, seeking for your assistance on how to not perform my 2nd, 3rd,4th etc.. function if my 1st function is in else condition. #Body function1() { if then echo "exist" else echo "not exist" } #if not exist in function1 my all other function will not proceed.... (4 Replies)
Discussion started by: meister29
4 Replies
jfs_debugfs(8)						      JFS file system editor						    jfs_debugfs(8)

NAME
jfs_debugfs - shell-type JFS file system editor SYNOPSIS
jfs_debugfs device DESCRIPTION
jfs_debugfs is a program which can be used to perform various low-level actions on a JFS formatted device. device is the special file name corresponding to the actual device to be edited (e.g. /dev/hdb1). jfs_debugfs must be run as root. COMMANDS
a[lter] <block> <offset> <hex_string> replaces the data located at the <offset> of <block> with <hex_string> <block> is the block number - given in decimal <offset> is the offset within that block - given in hexadecimal <hex_string> is an even-numbered string of hexadecimal digits to write to the disk b[tree] <block> [<offset>] * not implemented yet * displays one node of the btree located at <offset> of <block> and enters a subcommand mode to navigate the btree SUBCOMMANDS: l => visit left sibling m => modify current node p => visit parent node r => visit right sibling [0-9] => visit the n'th child node x => exit subcommand mode cb[blfsck] displays the area used by ClearBadBlockList for communication with fsck SUBCOMMANDS: m => modify entries x => exit subcommand mode dir[ectory] <inode_number> [<file_set>] displays the directory entries at <inode_number> and enters subcommand mode <inode_number> is the directory's inode - given in decimal <file_set> currently must be zero SUBCOMMANDS: m => modify entries x => exit subcommand mode d[isplay] [<block> [<offset> [<format> [<count>]]]] displays <count> objects located at the <offset> of <block> in <format> <block> is the block number - given in decimal <offset> is the offset within <block> - given in hexadecimal <format> is one of the following: a => ascii b => block allocation map d => decimal i => inode I => inode allocation map s => superblock x => hexadecimal X => extent allocation descriptor <count> is the number of objects to display - given in decimal dm[ap] displays aggregate disk (block) map SUBCOMMANDS m => modify map fields f => display free count t => display tree levels x => exit subcommand mode dt[ree] <inode_number> [<file_set>] displays root of the directory btree located at <inode_number> and enters a subcommand mode to navigate the btree <inode_number> is the directory's inode - given in decimal <file_set> currently must be zero SUBCOMMANDS l => visit left sibling m => modify current node p => visit parent node (not parent directory) r => visit right sibling [0-9] => visit the n'th child node x => exit subcommand mode fsckw[sphdr] displays the header of the fsck workspace in the aggregate SUBCOMMANDS: m => modify entries x => exit subcommand mode h[elp] [<command>] displays help for <command> if no command is given, all possible commands are displayed ia[g] [<IAG_number>] [a | s | <file_set>] displays IAG information for <IAG_number> and enters subcommand mode <IAG_number> is given in decimal a is to use the primary aggregate inode table s is to use the secondary aggregate inode table <file_set> currently must be zero SUBCOMMANDS e => display/modify inode extents map m => modify IAG p => display/modify persistent map w => display/modify working map x => exit subcommand mode i[node] [<inode_number>] [a | s | <file_set>] displays inode information for <inode_number> and enters subcommand mode <inode_number> is given in decimal a is to use the primary aggregate inode table s is to use the secondary aggregate inode table <file_set> currently must be zero SUBCOMMANDS a => display/modify inode's ACL m => modify inode x => exit subcommand mode logs[uper] displays the journal log superblock and enters subcommand mode SUBCOMMANDS m => modify journal log superblock x => exit subcommand mode q[uit] exits jfs_debugfs se[t] [<variable> <value>] * not implemented yet * set user-defined <variable> to <value> if no arguments are given, displays all set variables <variable> must begin with an alphabetic character su[perblock] [p | s] displays superblock data p displays the primary superblock s displays the secondary superblock SUBCOMMANDS: m => modify entries x => exit subcommand mode s2p[erblock] [p | s] displays alternate superblock data p displays the primary superblock s displays the secondary superblock SUBCOMMANDS: m => modify entries x => exit subcommand mode u[nset] <variable> * not implemented yet * deletes user-defined <variable> xt[ree] <inode_number> [<file_set>] displays root of the non-directory btree located at <inode_number> and enters a subcommand mode to navigate the btree <inode_number> is the directory's inode - given in decimal <file_set> currently must be zero SUBCOMMANDS l => visit left sibling m => modify current node p => visit parent node (not parent directory) r => visit right sibling [0-9] => visit the n'th child node x => exit subcommand mode REPORTING BUGS
If you find a bug in JFS or jfs_debugfs, please report it via the bug tracking system ("Report Bugs" section) of the JFS project web site: http://jfs.sourceforge.net/ Please send as much pertinent information as possible, including the complete output of running jfs_fsck with the -v and -n options on the JFS device. SEE ALSO
jfs_fsck(8), jfs_mkfs(8), jfs_fscklog(8), jfs_logdump(8), jfs_tune(8), AUTHORS
Barry Arndt (barndt@us.ibm.com) William Braswell, Jr. jfs_debugfs is maintained by IBM. See the JFS project web site for more details: http://jfs.sourceforge.net/ October 29, 2002 jfs_debugfs(8)
All times are GMT -4. The time now is 09:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy