variable="bu sozcuk Turkce"
echo ${variable%sozcuk*}
bu (sozcuk'ten öncesi)
echo ${variable#*sozcuk}
Turkce (sozcuk'ten sonrası)
Unix, Linux, JBoss, Websphere, Ant, Python, Oracle DB, Arduino, Raspberry Pi.
12 Mart 2018 Pazartesi
8 Mart 2018 Perşembe
20 Kasım 2017 Pazartesi
Batch - Değişkenler ile Replace
@echo off
setlocal enabledelayedexpansion
set string=Uzun bir cumle
set find=Uzun
set replace=Kisa
call set string=%%string:!find!=!replace!%%
echo %string%
Output = Kisa bir cumle
setlocal enabledelayedexpansion
set string=Uzun bir cumle
set find=Uzun
set replace=Kisa
call set string=%%string:!find!=!replace!%%
echo %string%
Output = Kisa bir cumle
Batch - String'den silme
@echo off
set string=Uzun bir cumle
set string=%string:Uzun=%
echo %string%
Output = bir cumle
set string=Uzun bir cumle
set string=%string:Uzun=%
echo %string%
Output = bir cumle
Batch - Dosya ismindeki uzantıyı silmek
@echo off
for /R "C:\Path" %%f in (*.txt) do (
echo %%~nf
)
pause
for /R "C:\Path" %%f in (*.txt) do (
echo %%~nf
)
pause
Bash - Dosyanın her satırına string prepend etmek
for /f "tokens=*" %a in (input.txt) do (echo oncul_metin.%a) >> output.txt
Kaydol:
Kayıtlar (Atom)