Sponsored Content
Top Forums Shell Programming and Scripting Passing control back to the shell script Post 302974847 by stomp on Saturday 4th of June 2016 05:33:40 PM
Old 06-04-2016
Hi,

First hint:
Please close your if-construct with fi !

Code:
if expression
then
      then-commands...
else
      else-commands...
fi

maybe it works not as you suspect. But it works. The exit status is not printed, it is only set. You get your exit status with: $? And $? ist set new after every command. So if you want to get the exit status, you must read it directly after the command execution, or it is overwritten with the exit status of the next command.

Try this:


Code:
./test.sh abc >>test.log ; echo $? >>tst.log

 

10 More Discussions You Might Find Interesting

1. Programming

Passing Parameters and getting values back from a c program to Shell script

I am having a shell script which has to be called from a C program. I have to pass two parameters to this script. HOw can I do that? eg: int main() { char st1; char str2; // call a shell script call_sh(str1,str2) where call_sh is the name of the shell script. then i need to get the return... (5 Replies)
Discussion started by: Rajeshsu
5 Replies

2. Shell Programming and Scripting

passing oracle parameters back to Shell

Hi All, Does anyone have any solutions for passing back multiple variables back to the SHELL from a call to an ORACLE procedure: eg #username='scott' #password='tiger' #database='orcl' username='ITGCD03D03' password='tC5epIew' database='ITGCD03D' sqlplus -s... (4 Replies)
Discussion started by: satnamx
4 Replies

3. Shell Programming and Scripting

control over shell script

Hi.. I have a perl program that uses "system" to execute a shell script called startengine. The script "startengine" itself calls a lot of other smaller scripts to setup the engine etc. It finally has to execute ./engine which is another shell script which is long and takes a long time to... (3 Replies)
Discussion started by: JLJ
3 Replies

4. Shell Programming and Scripting

How to Control Cronjobs using Shell Script??

Hi All, Now i am running the 3 oracle procedures one by one manually. Query: If 1st Procedure OUT_PUT is Success, then call 2nd Procedure. If 2nd Procedure OUT_PUT is Success, then call 3rd Procedure. If 1st Procedure is failed, then no need of calling the other ... (8 Replies)
Discussion started by: hanu_oracle
8 Replies

5. Solaris

how to get back a SVM volume to solaris control

hi.., help me in this case... 1) now the disk is under disksuite, its have some mirrored volume. how can i get back this disk to OS control. 2) how can i know the a SVM volume avalable,used space. and the filesystem size on tht volume please help in this i am bigginer... (5 Replies)
Discussion started by: b.janardhanguru
5 Replies

6. Shell Programming and Scripting

Passing a variable from a child script back to the parent

Hi I have written a script using ftp to get files from one server and copy them to 2 dirrerent servers. I wish to call this script from a parent script that will check the number of files copied and run a check sum for each file. As the filenames for the files in the get portion of the script... (3 Replies)
Discussion started by: Andy82
3 Replies

7. Shell Programming and Scripting

how to write shell script to take back up

Helo, I want to write shell script which takes back of all binaries (exe files). and when i uninstall the upgraded system which automatically restore the old binary which we have take as back up. can u tell me how to write such shell scripts. Regards, Amit (5 Replies)
Discussion started by: amitpansuria
5 Replies

8. Shell Programming and Scripting

Version Control Through the Shell Script

Version Control Through the Shell Script Hi Guys, Apologize for the big request, please take some time and read it completely... This is Very important for me, and ur help is Very much Appriciated. I want to maintain the Version control to all my scripts running in Production server, I am... (6 Replies)
Discussion started by: Anji
6 Replies

9. Shell Programming and Scripting

Ampersand not giving back the control (Korn shell)

OS version : AIX 6.1 Shell : Korn When you 'postfix' a command with ampersand (&) , it is supposed to run in the background and give you back the control. I tested this with ping command (by default it pings every 1 second ) After I ran the below ping command with ampersand, I pressed... (3 Replies)
Discussion started by: polavan
3 Replies

10. Shell Programming and Scripting

Passing error message back to script

I have one script that calls another script during execution. The other script does some processing, then either returns with exit 0 (if successful), or exits with error code numbers (if failed). However, in addition to the error code, I would like for that second script to be able to pass a... (4 Replies)
Discussion started by: AcerAspirant
4 Replies
platform::shell(n)					       Tcl Bundled Packages						platform::shell(n)

__________________________________________________________________________________________________________________________________________________

NAME
platform::shell - System identification support code and utilities SYNOPSIS
package require platform::shell ?1.1.4? platform::shell::generic shell platform::shell::identify shell platform::shell::platform shell _________________________________________________________________ DESCRIPTION
The platform::shell package provides several utility commands useful for the identification of the architecture of a specific Tcl shell. This package allows the identification of the architecture of a specific Tcl shell different from the shell running the package. The only requirement is that the other shell (identified by its path), is actually executable on the current machine. While for most platform this means that the architecture of the interrogated shell is identical to the architecture of the running shell this is not generally true. A counter example are all platforms which have 32 and 64 bit variants and where a 64bit system is able to run 32bit code. For these running and interrogated shell may have different 32/64 bit settings and thus different identifiers. For applications like a code repository it is important to identify the architecture of the shell which will actually run the installed packages, versus the architecture of the shell running the repository software. COMMANDS
platform::shell::identify shell This command does the same identification as platform::identify, for the specified Tcl shell, in contrast to the running shell. platform::shell::generic shell This command does the same identification as platform::generic, for the specified Tcl shell, in contrast to the running shell. platform::shell::platform shell This command returns the contents of tcl_platform(platform) for the specified Tcl shell. KEYWORDS
operating system, cpu architecture, platform, architecture platform::shell 1.1.4 platform::shell(n)
All times are GMT -4. The time now is 06:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy