Здравейте нов съм в програмирането на скриптове и имам нужда от вашата помощ за следния скрипт:
Substitution of text within a file: Now suppose you wanted to find and replace some words in a text file. You could do this manually using find and replace in a text editor. However, you could also write a script to automate the task. Here is an example which replaces 'plus' with '+':
echo "x is 5 plus 6" | sed 's/plus/+/g'
We now use sed instead of grep. In the expression s/plus/+/g, the 's' means substitute the second part (separated by '/') for the first and the 'g' means do this everywhere rather than just on the first occurrence. However it is possible to write this in one line (without error checking) using regular expressions. Below is a template, can you fill in the regular expression?
#!/bin/sh
expr `echo $* | sed ''`
exit 0
Въобще нямам представа как да го напиша този скрипт
