I need to input the path of a file in shell script as a variable and use the file in the same script.Suppose the path is /home/pi/dest/file
and i want to use the file
as a variable.Can anyone tell me the syntax to open specified path file
1 Answer
I think your question is not clear. But you can see below what I understood;
basename /home/pi/dest/file
basename command will give you the last component of the path.
file
)? Or do you want to put the file content in a variable? Or is the problem getting the user to provide the path?