Mounting Samba File Sharing on Linux / Ubuntu system within single command

The command used to mount Samba file sharing is 'gio'(gnome input/output) utility.
 gio mount smb://<server_address>/<share>
Where we need to provide three things :
  • Username
  • Password
Example :
 $ gio mount smb://
 Password required for share anonymous on
 User [ajay]: Anonymous
 Password: <-------Password_here
Automating the whole Process with a Shell script :
File :
# Mount smb file server with below credentials 
# Name : Anonymous
# Password : Anonymous

echo -e "Anonymous\nWORKGROUP\nAnonymous" | gio mount \
smb:// >> /dev/null 2>&1

Creating an alias for in .bashrc file :

Open your '.bashrc' file on any editor and at the last line add this :
 alias smbmount="~/scripts/"
I put script at "~/scripts/", you can change it accoring to your location. Now open a new terminal and type 'smbmount' to mount smsb share on your destro.
 $ smbmount
Cheers !!