GREP
grep -E "[0-24]+(:[0-59]){1,}" a.txt
grep -E "^[A-Z]" a.txt
SED
sed -E "s/([13579])([aeiou])/\2\1/g" a.txt
sed -E "s/([0-9])([0-9])/\2\1/gi" a.txt
AWK
awk '{print s=$1 + $2 }' number
UNIX SHELL
cat scor | sort | uniq -u
files=`find ./ -maxdepth 1 -type f`
ok=0
for file in $files
do
IFS=$'\\n'
ok=0
for line in ` cat $file `
do
if echo $line | grep -E -q "cat"
then
ok=1
fi
done
if [ $ok -eq 1 ]
then
echo $file
fi
done
open()
function typically takes two arguments: the path to the FIFO and a flag that specifies the read mode (e.g. O_RDONLY
or equivalent)
this call establishes a file descriptor that represents the open FIFO.
open()
function may block the calling process if the FIFO is not yet open for writing
open()
call will block until another process opens the same FIFO for writing
this ensures that the reader does not start reading until there is data available to be read
once the FIFO is successfully opened for reading, the process can then proceed to read data from the FIFO