0

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
  • Do you want to put the path in a variable? Or just the base name (file)? Or do you want to put the file content in a variable? Or is the problem getting the user to provide the path? Commented Apr 5, 2016 at 23:38

1 Answer 1

0

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.