Reputation: 2222
I want to present the user with a string to edit and enter. For example:
$edpath filen*
Edit> /home/user1/bla/bla/foo/bar/bar/dir1/dir2/filename.xyz
And after the user edits the string and hits enter:
You entered: /home/user2/foobar/dir1/dir2/filename.xyz
$
What bash command does this, if any?
Upvotes: 1
Views: 198
Reputation: 80921
For bash 4.1+
(or so, I'm not sure of the exact version).
$ read -re -p 'Edit> ' -i '/home/user1/bla/bla/foo/bar/bar/dir1/dir2/filename.xyz' filename
$ echo "You entered: $filename"
Upvotes: 2