Using $1, $2 in sed command in shell function
Posted on 2004-09-15
Hi Im trying to right a shell function that takes as its first arg a string/pattern to search for, and a second arg as the file or files in which to search.
echo "first argument is: $1"
echo " second argument is: $2"
sed -en "/$1/p" $2
[root@jekyll bin]# testfind he /root/parrot
first arg: he
second arg: /root/parrot
bash: the: command not found
also once I have created a function at the prompt how do I edit it?