I have a problem with the small script I am working on, can you please explain why is this not working:
#!/bin/bash
var1=$( linux command to list ldap users | grep "user: $1")
echo $var1
So, when I deploy my script ( ./mycript.sh $michael ), it should use that value instead of $1 and provide the output via echo $variable1? In my case that is not working.
Can you please explain how should I configure positional parameter inside the variable?
I tried the this solution, but that did not help:
#!/bin/bash
var1=$( linux command to list ldap users | grep user: $1)
echo $var1