Sponsored Content
Top Forums Shell Programming and Scripting To skip operations in UNIX shell Post 302899865 by RudiC on Friday 2nd of May 2014 06:39:32 AM
Old 05-02-2014
If your shell allows for here documents, you could try
Code:
script.sh
<<EOF
rm text
for i in *
do
.
.
.
.
.
EOF
if [x = y] then  rm

Make sure that the token (here:EOF) does not occur anywhere in the portion to be skipped.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

mathematics operations in unix

Hello guys! Can say me anybody about operatios with unix, I don't to make operations, only inside in a variable, like this #y=4 #x=2 #let z=$y-$x #echo $z # 2 but I can't to make mathematical operations with decimal like this #y=3.2 #x=1.5 #let z=$y-$x #echo $z # 3 this... (2 Replies)
Discussion started by: cesar720213
2 Replies

2. Shell Programming and Scripting

Unix file operations(shell script)

Hi, I want to compare two files. Files will look like as follows: file1: ASDFGHJU|1234567890123456 QWERTYUI|3456789098900890 file2: ZXCVBVNM|0987654321234567 POLKIJUYH|1234789060985478 output file should be: ASDFGHJU|1234567890123456 QWERTYUI|3456789098900890 Thnaks in advance (6 Replies)
Discussion started by: nivas
6 Replies

3. Shell Programming and Scripting

Unix File operations

Hi, Iam having the two files as follows: file1: ASQWEDFR09876543121234512 POIUYTREW09876512345676788 ZXCVBNMKS1209888888888888 file2: ASQWEDFR09876543121234516 asdcvfgbtg@abc.com 0000000-90-1239--2008 8990---- CXADFGTU09876543121234789 asdcvfgbtg@abc.com ... (14 Replies)
Discussion started by: nivas
14 Replies

4. Shell Programming and Scripting

Date operations in Unix?

Hi Friends, I need help in below requirements, 1. I have to get current datetime + <mins> into a variable 2. I have to compage dates like, A=01-JAN-2009 10:20:10 B=01-JAN-2009 10:30:00 C=<same format date as above> I have to find whether, 1. C is less than A OR, 2. C is greater... (7 Replies)
Discussion started by: smr_rashmy
7 Replies

5. IP Networking

What is the best Unix-like for firewalling operations

Hello from France, I'd like to have your opinion on this : What unix-like would you choose for high bandwidth netwoking operations like a cluster of statefull firewalls ? NetBSD, Linux, others ? Thank you. Best regards. Vincent. (0 Replies)
Discussion started by: vrzs
0 Replies

6. Shell Programming and Scripting

Unix Shell scripting -How to skip User Standard input section from another script

All, problem Description: For example: I have two shell scripts(executables). let name it as script1 and script2.I'm trying to execute script1 from script2. while executing script2, script1 is asking for manual input(input from keyboard). Now i need to know how I can skip this user input... (3 Replies)
Discussion started by: techie99
3 Replies

7. Programming

shell cursor operations

Hi I need to save the actual cursor position into variable in my script. How can I do it ? thx for help. (1 Reply)
Discussion started by: presul
1 Replies

8. Shell Programming and Scripting

How to skip the first line of the script in shell using python?

How to skip first line of the script in shell, using python. (3 Replies)
Discussion started by: KarthikPS
3 Replies

9. Shell Programming and Scripting

Shell operations from C++

Hi everyone, I need little help in shell operations from C++ program. Here I furnish the details of problem: 1. Lets say my current working path is myWorkingPath. 2. In my working path I have list of name directories and each name directory has two more sub directories say A/B. (now path to... (5 Replies)
Discussion started by: linuxUser_
5 Replies
GIT-SHELL(1)							    Git Manual							      GIT-SHELL(1)

NAME
       git-shell - Restricted login shell for Git-only SSH access

SYNOPSIS
       chsh -s $(command -v git-shell) <user>
       git clone <user>@localhost:/path/to/repo.git
       ssh <user>@localhost

DESCRIPTION
       This is a login shell for SSH accounts to provide restricted Git access. It permits execution only of server-side Git commands implementing
       the pull/push functionality, plus custom commands present in a subdirectory named git-shell-commands in the user's home directory.

COMMANDS
       git shell accepts the following commands after the -c option:

       git receive-pack <argument>, git upload-pack <argument>, git upload-archive <argument>
	   Call the corresponding server-side command to support the client's git push, git fetch, or git archive --remote request.

       cvs server
	   Imitate a CVS server. See git-cvsserver(1).

       If a ~/git-shell-commands directory is present, git shell will also handle other, custom commands by running "git-shell-commands/<command>
       <arguments>" from the user's home directory.

INTERACTIVE USE
       By default, the commands above can be executed only with the -c option; the shell is not interactive.

       If a ~/git-shell-commands directory is present, git shell can also be run interactively (with no arguments). If a help command is present
       in the git-shell-commands directory, it is run to provide the user with an overview of allowed actions. Then a "git> " prompt is presented
       at which one can enter any of the commands from the git-shell-commands directory, or exit to close the connection.

       Generally this mode is used as an administrative interface to allow users to list repositories they have access to, create, delete, or
       rename repositories, or change repository descriptions and permissions.

       If a no-interactive-login command exists, then it is run and the interactive shell is aborted.

EXAMPLE
       To disable interactive logins, displaying a greeting instead:

	   $ chsh -s /usr/bin/git-shell
	   $ mkdir $HOME/git-shell-commands
	   $ cat >$HOME/git-shell-commands/no-interactive-login <<EOF
	   #!/bin/sh
	   printf '%s
' "Hi $USER! You've successfully authenticated, but I do not"
	   printf '%s
' "provide interactive shell access."
	   exit 128
	   EOF
	   $ chmod +x $HOME/git-shell-commands/no-interactive-login

       To enable git-cvsserver access (which should generally have the no-interactive-login example above as a prerequisite, as creating the
       git-shell-commands directory allows interactive logins):

	   $ cat >$HOME/git-shell-commands/cvs <<EOF
	   if ! test $# = 1 && test "$1" = "server"
	   then
		   echo >&2 "git-cvsserver only handles "server""
		   exit 1
	   fi
	   exec git cvsserver server
	   EOF
	   $ chmod +x $HOME/git-shell-commands/cvs

SEE ALSO
       ssh(1), git-daemon(1), contrib/git-shell-commands/README

GIT
       Part of the git(1) suite

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