blallo 2019-05-11 14:17:48 +02:00
commit beee2bf6f8
Se han modificado 14 ficheros con 75 adiciones y 0 borrados

Ver fichero

@ -0,0 +1,4 @@
#!/usr/bin/env bash
touch pippo.txt
ls -l pippo.txt

Ver fichero

@ -0,0 +1,4 @@
#!/usr/bin/env bash
cp pippo.txt pluto.prova
ls -l pluto.prova

Ver fichero

@ -0,0 +1,3 @@
#!/usr/bin/env bash
mkdir scatolone

Ver fichero

@ -0,0 +1,3 @@
#!/usr/bin/env bash
chmod a-rw scatolone

Ver fichero

@ -0,0 +1,14 @@
#!/usr/bin/env bash
START=$(date --date="20190101" +%s)
LEN=$(date +%j)
for INTDATE in $(seq $LEN)
do
DELTA=$(( INTDATE*86400 ))
TIME=$(( START+DELTA ))
DATE=$(date --date="@${TIME}" +%Y%m%d)
mkdir $DATE
done

Ver fichero

@ -0,0 +1,4 @@
#!/usr/bin/env bash
mkdir Archivio
mv ../02-create_dirs/2019* Archivio

10
03-mv_files/02.sh 100644
Ver fichero

@ -0,0 +1,10 @@
#!/usr/bin/env bash
cd Archivio
mkdir {Mon,Tue,Wed,Thu,Fri,Sat,Sun}
for FOLDER in $(ls -1 2019*)
do
DAY=$(date --date=${FOLDER%:} +%a)
mv ${FOLDER%:} $DAY
done

Ver fichero

@ -0,0 +1,3 @@
#!/usr/bin/env bash
find / -name passwd

Ver fichero

@ -0,0 +1,4 @@
#!/usr/bin/env bash
find / -ctime -7
find / -mtime -7

Ver fichero

@ -0,0 +1,3 @@
#!/usr/bin/env bash
find / -name "conf*" -type d

Ver fichero

@ -0,0 +1,3 @@
#!/usr/bin/env bash
curl http://world.std.com/~wij/dante/paradiso.txt -s|grep -i beatrice

Ver fichero

@ -0,0 +1,3 @@
#!/usr/bin/env bash
curl http://world.std.com/~wij/dante/inferno.txt -s|grep "[0-9]"

Ver fichero

@ -0,0 +1,7 @@
#!/usr/bin/env bash
wget http://world.std.com/~wij/dante/inferno.txt
wget http://world.std.com/~wij/dante/purgatorio.txt
wget http://world.std.com/~wij/dante/paradiso.txt
grep -i -r "\(virgilio\|beatrice\|dio\)"

Ver fichero

@ -0,0 +1,10 @@
#!/usr/env/bin bash
cp ../05-search_text/*txt .
for TEXT in *txt
do
sed -i"" "s/Virgilio/PLACEHOLDER/g" $TEXT
sed -i"" "s/Beatrice/Virgilio/g" $TEXT
sed -i"" "s/PLACEHOLDER/Beatrice/g" $TEXT
done