Sponsored Content
Top Forums Shell Programming and Scripting Calling Bash Functions in the BG Post 302976949 by RudiC on Friday 8th of July 2016 02:15:07 PM
Old 07-08-2016
... which is equivalent to
Code:
command <input.txt &>output.txt

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling functions in scripts directly

Hi, I have a menu driven script that does various tasks, I want to be able to call functions directly from within other unix scripts from my menu script. Is this possible? (12 Replies)
Discussion started by: LiquidChild
12 Replies

2. Shell Programming and Scripting

Calling Functions of Other K Shell Program

Hi, I have a K shell a.ksh function abc { // Some logic } In b.ksh i have included the a.ksh ./a.ksh I want to call the abc function from this b.ksh script. Thanks Vijay (2 Replies)
Discussion started by: vijaykrc
2 Replies

3. Shell Programming and Scripting

Mathematical functions in bash shell

Hi, How can i do the mathematical calculations in bash shell? Are the mathematical functions available in bash shell? Ex: pow ceil floor sqrt (5 Replies)
Discussion started by: cola
5 Replies

4. Shell Programming and Scripting

bash functions arguments

This script is called fuu; #!/bin/bash speak() { case $1 in 1)echo one ;; 2)echo two ;; 3)echo three ;; esac } speak exit 0 when i run fuu 2 i expect "two" like... (2 Replies)
Discussion started by: Tártaro
2 Replies

5. Shell Programming and Scripting

Is it possible make the shell read functions 1 by 1 and calling an other function?

Greetings, I m wondering if it's possible do do the following : I have a simple function called "FindMoveDelete" which does the following : FindMoveDelete() { find . -iname "$FILENAME*.ext" -exec mv {} "$PATH/$VAR" \; && find . -maxdepth 1 -type d -iname "$FILENAME*" -exec rm -rf {}... (6 Replies)
Discussion started by: Sekullos
6 Replies

6. Shell Programming and Scripting

Calling multiple functions in parallel

Hello, I have multiple functions within a shell script. eg. function_database_backup, unix_tar_creation, etc. I would like to run these functions in parallel, as each is independent of the other. If these were simple commands, I could have probably run each of the commands in background. ... (1 Reply)
Discussion started by: neil.k
1 Replies

7. Shell Programming and Scripting

functions and variables in bash

I have a bash script with some functions as below and am wondering if I can use the variables declared in setup in the other functions and in the rest of the bash script. setup(){ none=0; low=1; medium=2; high=3; debug=4 var1="red" var2="fred" } create_basemap() { ... (7 Replies)
Discussion started by: kristinu
7 Replies

8. AIX

Calling functions from main program from dlopened library function

Hello All, I am trying to call a function from the calling main program from a dlopened library function, below is the entire code, when I execute it it crashes with sigill. Can you guys help me out I guess I am missing out on the linker flag or something here. besides I am new to AIX and... (1 Reply)
Discussion started by: syedtoah
1 Replies

9. Shell Programming and Scripting

Bash calling a few functions syntax error

In the bash function below if the user selets "y" then the menu function is called and if they select "n" the move function is called. That all seems to work, my question is after the files are moved an echo, line in bold is displayed and another function called backup is called. I am getting a... (1 Reply)
Discussion started by: cmccabe
1 Replies

10. Shell Programming and Scripting

Bash functions sequence ?

OK, I know function has to be defined first - in sequence - before it can be used. So the script has to be build "bottoms -up style, if you pardon my expression. I am running into a problem reusing function and breaking the sequence. It would be nice to be able to see the function... (10 Replies)
Discussion started by: annacreek
10 Replies
GIT-SH-SETUP(1) 						    Git Manual							   GIT-SH-SETUP(1)

NAME
       git-sh-setup - Common Git shell script setup code

SYNOPSIS
       . "$(git --exec-path)/git-sh-setup"

DESCRIPTION
       This is not a command the end user would want to run. Ever. This documentation is meant for people who are studying the Porcelain-ish
       scripts and/or are writing new ones.

       The git sh-setup scriptlet is designed to be sourced (using .) by other shell scripts to set up some variables pointing at the normal Git
       directories and a few helper shell functions.

       Before sourcing it, your script should set up a few variables; USAGE (and LONG_USAGE, if any) is used to define message given by usage()
       shell function. SUBDIRECTORY_OK can be set if the script can run from a subdirectory of the working tree (some commands do not).

       The scriptlet sets GIT_DIR and GIT_OBJECT_DIRECTORY shell variables, but does not export them to the environment.

FUNCTIONS
       die
	   exit after emitting the supplied error message to the standard error stream.

       usage
	   die with the usage message.

       set_reflog_action
	   Set GIT_REFLOG_ACTION environment to a given string (typically the name of the program) unless it is already set. Whenever the script
	   runs a git command that updates refs, a reflog entry is created using the value of this string to leave the record of what command
	   updated the ref.

       git_editor
	   runs an editor of user's choice (GIT_EDITOR, core.editor, VISUAL or EDITOR) on a given file, but error out if no editor is specified
	   and the terminal is dumb.

       is_bare_repository
	   outputs true or false to the standard output stream to indicate if the repository is a bare repository (i.e. without an associated
	   working tree).

       cd_to_toplevel
	   runs chdir to the toplevel of the working tree.

       require_work_tree
	   checks if the current directory is within the working tree of the repository, and otherwise dies.

       require_work_tree_exists
	   checks if the working tree associated with the repository exists, and otherwise dies. Often done before calling cd_to_toplevel, which
	   is impossible to do if there is no working tree.

       require_clean_work_tree <action> [<hint>]
	   checks that the working tree and index associated with the repository have no uncommitted changes to tracked files. Otherwise it emits
	   an error message of the form Cannot <action>: <reason>. <hint>, and dies. Example:

	       require_clean_work_tree rebase "Please commit or stash them."

       get_author_ident_from_commit
	   outputs code for use with eval to set the GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL and GIT_AUTHOR_DATE variables for a given commit.

       create_virtual_base
	   modifies the first file so only lines in common with the second file remain. If there is insufficient common material, then the first
	   file is left empty. The result is suitable as a virtual base input for a 3-way merge.

GIT
       Part of the git(1) suite

Git 2.17.1							    10/05/2018							   GIT-SH-SETUP(1)
All times are GMT -4. The time now is 05:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy