Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Shell Script using smbclient

  • 23-09-2008 02:33PM
    #1
    Registered Users, Registered Users 2 Posts: 1,048 ✭✭✭


    Hey all, im in the middle of creating a shell script that:-

    - creates a file named according to the system date (using mkdir `date +%d_%m_%Y`
    - copies the contents of a particular directory into that file
    - copies the now fully laden file to a windows client

    Now, I can create all the files etc and access the share via smbclient, but
    when I do the following

    smb:>lcd /location/of/new/directory
    smb:>put `date +%d_%m_%Y` or even smb:>put `%d_%m_%Y`
    i get `date does not exist

    So I guess what Im asking is, can smbclient gain access to environment variables like date etc?If so, how do I specify it within the put command?

    Cheers,
    Bob


Comments

  • Registered Users, Registered Users 2 Posts: 564 ✭✭✭fishfoodie


    date isn't an env variable, its a program. If you specify the full path to the date binary it will probably work, try 'which date' & then putting in the path returned.


Advertisement