Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Whats wrong with this BASH ?

  • 21-05-2008 10:43am
    #1
    Closed Accounts Posts: 1,788 ✭✭✭


    date '+%F %T',/home/$USER/scanner $d $f >> $SORTING_EXT_FILE_SFR


    this is supposed to write 2 colums to a csv file ( $SORTING_EXT_FILE_SFR )

    the date and the file path , but it is doing nothing ...

    should i have the path /home/$USER/scanner $d $f in '' or "" ??


Comments

  • Registered Users, Registered Users 2 Posts: 2,534 ✭✭✭FruitLover


    jackdaw wrote: »
    date '+%F %T',/home/$USER/scanner $d $f >> $SORTING_EXT_FILE_SFR

    I'm guessing this comma is supposed to be a semi-colon


  • Registered Users, Registered Users 2 Posts: 868 ✭✭✭brianmc


    jackdaw wrote: »
    date '+%F %T',/home/$USER/scanner $d $f >> $SORTING_EXT_FILE_SFR


    this is supposed to write 2 colums to a csv file ( $SORTING_EXT_FILE_SFR )

    the date and the file path , but it is doing nothing ...

    should i have the path /home/$USER/scanner $d $f in '' or "" ??


    What are $d and $f about?

    The rest looks ok I think. Can't test it at the moment.


  • Registered Users, Registered Users 2 Posts: 545 ✭✭✭ravydavygravy


    jackdaw wrote: »
    date '+%F %T',/home/$USER/scanner $d $f >> $SORTING_EXT_FILE_SFR


    this is supposed to write 2 colums to a csv file ( $SORTING_EXT_FILE_SFR )

    the date and the file path , but it is doing nothing ...

    should i have the path /home/$USER/scanner $d $f in '' or "" ??

    Am I missing something? should it not be:
    echo "`date +'%F %T'`,/home/$USER/scanner $d $f" >> $SORTING_EXT_FILE_SFR
    

    assuming $d and $f are set somewhere already?


  • Registered Users, Registered Users 2 Posts: 868 ✭✭✭brianmc


    Am I missing something? should it not be:
    echo "`date +'%F %T'`,/home/$USER/scanner $d $f" >> $SORTING_EXT_FILE_SFR
    

    assuming $d and $f are set somewhere already?

    Any arbitrary text can be part of dates output format (such as the comma and pathname above) so you don't need echo.

    Assuming he wants the value of $d and $f as part of the output, he could do it your way or...
    date +"%F %T,/home/$USER/scanner $d $f" >> $SORTING_EXT_FILE_SFR
    


Advertisement