0

Following is the input from command line:

bash script.sh "input*" ";" "21" "yyyy-MM-dd"

and in my current directory i have two input files:

  • input1.txt
  • input2.txt

While i want to get value 'input*' from input '$1' i got 'input1.txt input2.txt' as input.

Is there any way to get value 'input*' from '$1'?

RaiBnod
  • 2,141
  • 2
  • 19
  • 25

1 Answers1

-1

you can use "$1" where 1 is the number of first input parameter

#!/bin/bash

echo "$1"

but you have to pass the input*.txt like this input\*.txt

output

[shell] ➤ ./test7.sh input\*.txt
input*.txt

Regards

Claudio

ClaudioM
  • 1,418
  • 2
  • 16
  • 42