As I understand
smbclient shell does not support
grep and io redirection. But you can just mount your samba share to local file system and use all features of bash shell.
You need to install cifs-utils.
$ sudo apt-get install cifs-utils
Now you should be able to mount samba share. Here is example
$ mount.cifs //192.168.1.1/share_point /path_to_your/local/folder -o user,uid=1000,rw,workgroup=DEV,credentials=/path_to_credentials/.cifs
You have to create
$ mkdir /mnt/my_share
and credentials file. I suggest to create folder
crd in your
$HOME, change permission to
$ mkdir ~/crd
$ chmod 700 ~/crd
.cifs file with this content:
Change permission to this file to
$ chmod 600 ~/crd/.cifs
Now you only need to substitute IP address:
$ mount.cifs //192.168.1.1/share_point /mnt/my_share -o user,uid=1000,rw,workgroup=DEV,credentials=$HOME/.cifs
You may also want this mount to be mounted on boot automatically. Add this to your
/etc/fstab, at the end
//192.168.1.1/share /mnt/my_share cifs uid=1000,credentials=$HOME/.cifs,iocharset=utf8,sec=ntlm,noauto,user 0 0
Don't forget to substitute $HOME with your home folder, and IP address with appropriate IP.
About fstab and smb mount