[prev in list] [next in list] [prev in thread] [next in thread]
List: bash-bug
Subject: Re: scripts one after the other
From: Quinn Fissler <qfissler () gmail ! com>
Date: 2016-03-29 8:56:27
Message-ID: CAD6paDvHVm-76J1Gq6HVm_TaHQAvcj_GVHprFCwX5KaZL0TZnw () mail ! gmail ! com
[Download RAW message or body]
On 26 March 2016 at 01:28, Val Krem <valkrem@yahoo.com> wrote:
>
> is it possible to combine the two scripts in one so that I can define the varietals \
> at one spot. It would be less prone to error.
Yes - you can have a script with a "case" and hard link to another
name (you can symlink but they're not as efficient as hard links)
#!/bin/bash
# set your variables here.
F=foo
B=bar
case "$0" in
"*1.sh")
check your parameters for the first script...
do stuff to create output | your_script_2.sh
;;
"*2.sh")
# some prog which reads input or read the input in bash
while read Col1 Col2 Col3 RestOfLine
do
do your stuff - reading a line at a time lets you pick off
columns if needed...
done
;;
"*[!12].sh")
echo We do not expect to be called $0
exit
;;
esac
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic