Markos <[EMAIL PROTECTED]> wrote: > #Delete "logo_1.gif" string from every line in results_1, > #leaving only the path to prepare for "cd" step > > sed 's/logo_1.gif//' /tmp/results_1 >/tmp/results
This would be more precisely expressed as: sed 's:/logo_1\.gif$:/:' /tmp/results_1 >/tmp/results If you happen to have a directory contining "logo_1.gif" in its name, your version won't do what you want. > sed -n $line_number"p" /tmp/results >"$path" ">" doesn't do what you want. It redirects the output of a command to a file. If you want to store the output in a shell variable, use this: path=$(sed -n "$line_number"p /tmp/results) > #We change to dir stored in the path variable > > cd $path Quotes would be useful here, in case you have a directory name containing spaces. paul _______________________________________________ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash