Diskuze: C shell - podmienka
Zobrazeno 4 zpráv z 4.
//= Settings::TRACKING_CODE_B ?> //= Settings::TRACKING_CODE ?>
google = shell argument if example
http://codewiki.wikidot.com/…ript:if-else
-- linux --
#!/bin/bash
if [ "$1" = "cool" ]
then
echo "Cool Beans"
else
echo "Not Cool Beans"
fi
google = shell argument if example dos
https://ss64.com/nt/if.html
--- s64 --- ackoliv netusim, co ta zkratka znamena :)
IF (%_var1%==(demo Echo the variable _var1 contains the text demo
google = shell argument if example win10
https://stackoverflow.com/…ne-arguments
IF "%1"=="" GOTO HAVE_0
IF "%2"=="" GOTO HAVE_1
IF "%3"=="" GOTO HAVE_2
---
if "%2" == "" goto args_count_wrong
if "%3" == "" goto args_count_ok
---
@echo off
setlocal EnableExtensions EnableDelayedExpansion
set /a arg_idx=1
set "curr_arg_value="
:loop1
if !arg_idx! GTR 9 goto :done
set curr_arg_label=%%!arg_idx!
call :get_value curr_arg_value !curr_arg_label!
if defined curr_arg_value (
echo/!curr_arg_label!: !curr_arg_value!
set /a arg_idx+=1
goto :loop1
)
:done
set /a cnt=!arg_idx!-1
echo/argument count: !cnt!
endlocal
goto :eof
:get_value
(
set %1=%2
)
Output:
count_cmdline_args.bat testing more_testing arg3 another_arg
%1: testing
%2: more_testing
%3: arg3
%4: another_arg
argument count: 4
1 min googlovani. Jak dlouho to resis?
Ups, mozna chces ceckovy zapis...
google = shell argument if example cpp
https://stackoverflow.com/…options-in-c
while ( infile.good() ) {
if (argv[1] == "-d")
{
---
if (std::strcmp(argv[1], "-d") == 0)
---
if (string(argv[1]) == "-d")
Absolútne si mi neodpovedal na otázku ale pekné, že si snažil byť za múdreho. Každopádne nevadí, poradil som si
Zobrazeno 4 zpráv z 4.