please anyone teach me how to do this assignment...
Please use basic things because i just learn the program only... thanks
The script should provide feedback to the user on what is happening. Everytime a reference is modified, the script should display:
Replaced <original reference> with <modified reference>.
and you got to save another copy of the file.
example like: you have a 1.shk, after working on it... you can "auto" save (Don't need user to select yes or no) the file to 1_modified.shk
then once the script has finished reading the source file, it should also display how many references were modified. For example:
A total of 3 references have been changed.
if you were to use sed to replace some word containing “C:\\temp\\project” in the shake file how can you make it replace those with “C:/temp/project”, “C:\\\\temp\\\\project” and even “C:/temp\\\\project”.??
I know this is too much... but can any kind soul help me here... i'm really in deep shit.... thanks... if you really don't understand... please msn me.. need to hand up by monday...
Substitutions like yours can be done with sed in the following ways. The patternseparating slashes can be replaced by any other character (in this case the pound sign) but this is for clarity purposes only; it doesn't take away the special meaning of the metacharacters in the pattern.
echo "C:\\temp\\project" | sed 's#\\#\/#g'
echo "C:\\temp\\project" | sed 's#\\#\\\\\\\\#g'
and in combination:
echo "C:\\temp\\project" | sed -e 's#\\#\/#' -e 's#\\#\\\\\\\\#'
Note that in the last example the 'g' as global qualifier is omitted in the
expressions to substitute the first occurrence of '\\' with '/' only
and make the second expression substitute the next occurrence with
'\\\\'. No other substitutions are made in this case.