Re: linux music tools It is quite possible and was done all the time in the bad

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Thank God you cannot use if and goto same way as in DOS.

echo Test bash batch file
if test -n "$1"
then
  echo You entered $1.
else
  echo You must enter a command line parameter.
fi

Note that on DOS example the execution iirc does not stop at the :end line.



--
mr. M01510 & guide Loadstone-GPS
Lat: 62.38718, lon: 25.64672
hkp://wwwkeys.pgp.net B784D020
0C1F 6A76 DC9D DD58 3383 8B5D 0E76 9600  B784 D02


 Tony Baechler kirjoitti
Subject: Re: linux music tools It is quite possible and was done all the time
    in the bad
Date: Wed, 29 Jul 2015 02:23:03 -0700
From: Tony Baechler <tony@xxxxxxxxxxxx>
To: Linux for blind general discussion <blinux-list@xxxxxxxxxx>

OK, how about this? Even taking into account the differences in command names (mv instead of rename, cp for copy, etc) how do you make something like this work?

@echo off
echo Test DOS batch file
if "%1" == "" goto help
goto end
:help
echo You must enter a command line parameter.
:end
echo You entered %1.

Granted, the above example doesn't actually do anything useful, but trying to do something simlar in bash won't work. Again, I realize you use $1 instead of %1, but you can't use "if" and "goto" in the same way. I don't think there even is a goto command.

On 7/28/2015 9:43 PM, Christopher Chaltain wrote:
I'm not sure why you're bringing aliases into the discussion. You don't'
need to use aliases if you're just writing a simple script analogous to a
batch file. If you want to batch commands in a shell script then you can do
that just as you do in DOS. The only real difference I can think of is that
your script file has to  be executable and has to start with the scripting
language you want to use. If that's what's making the outline of scripts
more complicated then I can't argue with that. If what you're familiar with
makes something simpler and makes more sense then again, I can't disagree
with that.


_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list


_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list



[Index of Archives]     [Linux Speakup]     [Fedora]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]