How to populate the variable with cat $1

Still I am not able to understand cat $1, how to use it, where to use it.

Please refer to the following link for better understanding
https://www.quora.com/What-does-1-mean-in-Bash-scripting

1 Like

Can u please check my code, what I am doing wrong, I have given a lot of time but unable to solve it.

have u seen my code, I am unable to debug it…

@khanempire

  • While using cat $1 INSIDE the shell script, it is an alias for the first command line argument we pass when running the bash(.sh) script. So, if we directly run cat $1 in the terminal, it wouldn’t give a response.
  • If you want to try if your command is working on the terminal first, use the full filename as parameter to cat command instead of $1

I am also having the same problem.

Try looking for how to pipe the output of one command as an input to other command. That will help you make sense out of the error.