Converting DOS Batch Files to Shell Scripts

Batch file keywords / variables / operators, and their shell equivalents

Batch File OperatorShell Script EquivalentMeaning
%$command-line parameter prefix
/command option flag
\/directory path separator
===(equal-to) string comparison test
!==!!=(not equal-to) string comparison test
||pipe
@set +vdo not echo current command
**filename “wild card”
>>file redirection (overwrite)
>>>>file redirection (append)
<<redirect stdin
%VAR%$VARenvironmental variable
REM#comment
NOT!negate following test
NUL/dev/null“black hole” for burying command output
ECHOechoecho (many more option in Bash)
ECHO.echoecho blank line
ECHO OFFset +vdo not echo command(s) following
FOR %%VAR IN (LIST) DOfor var in [list]; do“for” loop
:LABELnone (unnecessary)label
GOTOnone (use a function)jump to another location in the script
PAUSEsleeppause or wait an interval
CHOICEcase or selectmenu choice
IFifif-test
IF EXIST FILENAMEif [ -e filename ]test if file exists
IF !%N==!if [ -z “$N” ]if replaceable parameter “N” not present
CALLsource or . (dot operator)“include” another script
COMMAND /Csource or . (dot operator)“include” another script (same as CALL)
SETexportset an environmental variable
SHIFTshiftleft shift command-line argument list
SGN-lt or -gtsign (of integer)
ERRORLEVEL$?exit status
CONstdin“console” (stdin)
PRN/dev/lp0(generic) printer device
LPT1/dev/lp0first printer device
COM1/dev/ttyS0first serial port

SOURCE:
https://www.tldp.org/LDP/abs/html/dosbatch.html

Advertisements

BASH Programming – Introduction HOW-TO

Bit old but extremely useful for beginners:

1. Introduction

2. Very simple Scripts

3. All about redirection

4. Pipes

5. Variables

6. Conditionals

7. Loops for, while and until

8. Functions

9. User interfaces

10. Misc

11. Tables

12. More Scripts

13. When something goes wrong (debugging)

14. About the document

SOURCE: http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html

Volvo S60, S80, V70, XC70, XC90 – Engine Oil Specifications

Oficial Volvo Tables of Recommended Oil Specs Grade and Viscosity for all Petrol and Diesel Engines for Volvo S60 (2000 to 2009), Volvo V70 (2000 to 2007), Volvo S80 (1998 to 2005), Volvo XC70 (2000 to 2007) and Volvo XC90 (2003 to 2015) models. Also information on Oil Volume quantity and mileage oil change interval.

 

Oil for Europe

Engine Code Fuel Type Service interval (km) Volume (liters) Grade Viscosity
B8444S – 4.4 V8  Petrol 30.000 Approx. 6.7 ACEA A5/B5 SAE 0W-30
B5204T3 – 2.0 T5 225 hp  Petrol 20.000 Approx. 5.8 ACEA A3/B3/B4 SAE 0W-30
B5204T4 – 2.0T 163 hp  Petrol 20.000 Approx. 5.8 ACEA A3/B3/B4 SAE 0W-30
B5204T5 – 2.0T 180 hp (until 2004)  Petrol 20.000 Approx. 5.8 ACEA A3/B3/B4 SAE 0W-30
B5204T5 – 2.0T 180 hp (2005 – on)  Petrol 30.000 Approx. 5.5 ACEA A5/B5 SAE 0W-30
B5244S – 2.4i 170 hp (until 2004)  Petrol 20.000 Approx. 5.8 ACEA A3/B3/B4 SAE 0W-30
B5244S – 2.4i 170 hp (2005 – on)  Petrol 30.000 Approx. 5.5 ACEA A5/B5 SAE 0W-30
B5244S2 – 2.4 140 hp (until 2004)  Petrol 20.000 Approx. 5.8 ACEA A3/B3/B4 SAE 0W-30
B5244S2 – 2.4 140 hp (2005 – on)  Petrol 30.000 Approx. 5.5 ACEA A5/B5 SAE 0W-30
B5234T3 – 2.3 T5 250 hp  Petrol 20.000 Approx. 5.8 ACEA A3/B3/B4 SAE 0W-30
B5244T3 – 2.4T 200 hp  Petrol 20.000 Approx. 5.8 ACEA A3/B3/B4 SAE 0W-30
B5244T5 – 2.4 T5 260 hp  Petrol 30.000 Approx. 5.5 ACEA A5/B5 SAE 0W-30
B5254T2 – 2.5T 210 hp (until 2004)  Petrol 20.000 Approx. 5.8 ACEA A3/B3/B4 SAE 0W-30
B5254T2 – 2.5T 210 hp (2005 – on)  Petrol 30.000 Approx. 5.5 ACEA A5/B5  SAE 0W-30
B5254T4 – R – 2.5 T 300 hp  Petrol 20.000 Approx. 5.5 ACEA A3/B3/B4 SAE 0W-30
B5244SG – 2.4 Bi-Fuel CNG  Petrol 20.000 Approx. 5.8 ACEA A3/B3/B4 SAE 0W-30
B5244SG2 – 2.4 Bi-Fuel LPG  Petrol 20.000 Approx. 5.8 ACEA A3/B3/B4 SAE 0W-30
B6324S – 3.2 238hp (2007)  Petrol 30.000 Approx. 7.7 ACEA A5/B5 SAE 0W-30
B6324S – 3.2 238hp (2008 on)  Petrol 30.000 Approx. 7.4 ACEA A5/B5 SAE 0W-30
B6324S5 – 3.2 243hp  Petrol 30.000 Approx. 6.8 ACEA A5/B5 SAE 0W-30
B6304S – 2.9 200 hp  Petrol 20.000 Approx. 6.6 ACEA A3/B3/B4 SAE 0W-30
B6294S – 2.9 200 hp  Petrol 20.000 Approx. 6.6 ACEA A3/B3/B4 SAE 0W-30
B6284T – 2.8 T6 272 hp  Petrol 20.000 Approx. 6.6 ACEA A3/B3/B4 SAE 0W-30
B6294T – 2.9 T6 272 hp  Petrol 20.000 Approx. 6.6 ACEA A3/B3/B4 SAE 0W-30
D5252T – 2.5D 140 hp  Diesel 15.000 / 20.000 Approx. 6.0 ACEA A3/B3/B4 SAE 5W-40
D5244T – D5 163 hp * (view note below)  Diesel 20.000 Approx. 6.5 ACEA A3/B3/B4 SAE 0W-30
D5244T2 – 2.4D 130 hp * (view note below)  Diesel 20.000 Approx. 6.5 ACEA A3/B3/B4 SAE 0W-30
D5244T3 – D5 185 hp * (view note below)  Diesel 20.000 Approx. 6.5 ACEA A3/B3/B4 SAE 0W-30
D5244T4 – D5 185 hp  Diesel 30.000 Approx. 5.7 ACEA A5/B5 SAE 0W-30
D5244T5 – 2.4D 163 hp  Diesel 30.000 Approx. 5.7 ACEA A5/B5 SAE 0W-30
D5244T6 – 2.4D 122 hp  Diesel 30.000 Approx. 5.7 ACEA A5/B5 SAE 0W-30
D5244T7 – 2.4D 126 hp  Diesel 30.000 Approx. 5.7 ACEA A5/B5 SAE 0W-30
D5244T18 – D5 200 hp  Diesel 30.000 Approx. 5.7 ACEA A5/B5 SAE 0W-30

Note: Oil grade ACEA A3/B3/B4 can NOT be replaced by any other oil than the one prescribed in the tables for engines D5244T, D5244T2, D5244T3.

 

SOURCEhttp://www.volvohowto.com/volvo-s60-s80-v70-xc70-xc90-oficial-recomended-engine-oil-specifications-petrol-and-diesel-engines/