I was trying to pass a variable another shell command.
To be clear;
passwdContent=$( getent passwd "$USER" )
echo "passwdcontent" $passwdContent
I get the "passwd" field from user "x". After this section I want to play with this variable.
But in here I couldn't solve how can I pass the "passwdContent" variable. I tried a way like this;
exampleVariable=[( "$passwdContent" | cut -d : -f 1 )]
After I want to echo the "exampleVariable" it gave me error.
I knew I can do this all of in one line. But I want to learn how can I do this.