This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Recursively traverse the Directories and | |
#Print the file contents inside those directories. | |
readFile(){ | |
while read line | |
do | |
echo "$line" | |
done < "$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Recursively traverse the directories | |
traverseDirectory(){ | |
for fileName in `ls $1/` | |
do | |
if [ -d $1/$fileName ]; then | |
echo "$1/$fileName" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
readFile(){ | |
while read line | |
do | |
echo $line | |
done < "$1" | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while read ip datee timee | |
do | |
echo "Details:" | |
echo $ip | |
echo $datee | |
echo $timee | |
echo "" | |
done < "$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Pass arguments of txt file via command line | |
while read line | |
do | |
echo $line | |
done < "$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pattern="abc" | |
replacedValue="cde" | |
sed -i "s/$pattern/$replacedValue/g" sedInput.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abc | |
oiewjf | |
cdeoewjfmpew | |
oiwegm | |
ab | |
bc | |
abc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Recursively traverse the directories | |
traverseDirectory(){ | |
for fileName in `ls $1/` | |
do | |
echo "$1/$fileName" | |
if [ -x $1/$fileName ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
removeExecutablePermission(){ | |
if [ -f $1 ]; then | |
#echo "regular file" | |
if [ -x $1 ]; then | |
#echo "remove permission" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
192.1.4.09 10:30 Arsenal | |
110.13.5.67 5:12 Chelsea | |
192.1.45.67 23:21 Man United | |
199.13.8.23 8:33 Man city | |
172.11.22.2 18:45 Arsenal | |
133.13.8.23 10:00 Moon colony | |
112.11.22.2 8:00 Mars colony | |
103.13.8.23 9:00 Jupiter colony | |
12.11.22.2 8:59 Europa colony |