Skip to main content
❗Linux tag removed. See: https://stackoverflow.com/tags/linux/info
Link
Cyrus
  • 90.1k
  • 15
  • 112
  • 173
Source Link

How to pass argument to a shell command in shell script from terminal

i am writing a shell script practice.sh. I want to give my first argument $1 from command line to ls command in script.e.g if I run my script in terminal $bash practice.sh *.mp3 the argument *.mp3 I want to use for ls command

#!/bin/bash
output=$ls $1

it doesn't work any help?