Adding lines of users TODO to motd

Hello,
I've been trying to customise radu242's /etc/issue from the thread https://bbs.archlinux.org/viewtopic.php?id=50845&p=3 into a user specific motd by replacing the text in the box with some lines from the users TODO.txt.
At the moment I have a working, but not really, version that a) doesn't actually use the motd, but echo's the message from /etc/profile,  b) relies on the user keeping their TODO in a specific place, and c) has very ugly bash coding because I'm only learning.
So, in order to finish this, I need more info and was hoping someone could help:
For a)
    Is there any way to call variables directly from the /etc/motd file? - I tried $HOME but that didn't work as I expect it hasn't been initialised by then.
For b)
    I'd like to export a TODO variable before I call the message, which would have to be done very early so it's available in /etc/profile (or motd, if possible). Is there a way of adding an option into the /etc/passwd parsing? I doubt it but it would be awesome if there was, also I'd really appreciate a method of automatically updating (preferably with confirmation from the user) such an option.
For c)
    My TODO's have a specific format, the titles start at the beginning of a line and end with a  :  then the next line is the most important task in that title. In order to put these lines into my logo I need (unless anyone knows a better way) to make the titles and first line underneath into separate variables. I've done this with:
12 TODOfile="$HOME/TODO/MainTODO.txt"
13 linenos=$( grep -n -P "^[A-Z].*:$" ${TODOfile} | sed 's/:.*//' )
14 i=0
15
16 for num in $linenos;
17 do
18 newline=$( sed -n "${num}p" ${TODOfile} )
19 ret[${i}]="${newline}"
20 i=$(( i+1 ))
21 num=$(( num+1 ))
22 newline=$( sed -n "${num}p" ${TODOfile} )
23 ret[${i}]="${newline}"
25 i=$(( i+1 ))
25 done
which I think must be overly complicated (especially the repetition in the for loop), but I can't make it any better at the moment and would really appreciate some pointers.
Also, as this was an exercise to help me understand a little more about what linux does upon login, any alternate routes using files I haven't thought of are very welcome.
Thanks in advance
Apple
Last edited by Apple (2013-04-02 20:42:45)

Cheers, I'll give that a go when I get back to my laptop.
With the other two, yes, kinda.
I'm trying to move the message to as early in the logging in process as possible (purely for learning purposes). At the moment I call the executeable from /etc/profile before I call any bashrc, so I have some env variables but I'm looking for a way to do it earlier. From what I've found I think all env variables at that point have come from the entry in /etc/passwd, but I can't see how to add another variable in there as the syntax is odd.
I know the /etc/motd file is printed out before the /etc/profile file is called, so I think the motd file doesn't have access to any env variables. My original aim was to put the message there and there seems to be something in PAM that calls the motd. I thought if I could make the PAM call user specific I coult create a different motd for each user and echo the message into each user's file upon the previous logout, but again different syntax that I can't understand.

Similar Messages

  • How to set the focus on the new added line in ALV list (OO)

    Dear Friends,
    I have an ALV list based on OO(using alv_grid->set_table_for_first_display), when I click the 'new' button to add a new line, the mouse arrow is always pointing to the first line - not the new created line for user to input!!.
    So how to set the focus (mouse arrow) on the new added line in ALV list for user to input it friendly?
    Thanks a lot!!

    Hello,
    To get the selected line row first we have get all the rows in the internal table.
    When u click on the button when it is creating the new line we have to pass the row number to the call method
    CALL METHOD <ref.var. to CL_GUI_ALV_GRID > ->get_selected_rows
       IMPORTING
          ET_INDEX_ROWS  =   <internal table of type LVC_T_ROW > (obsolete)
          ET_ROW_NO      =   <internal table of type LVC_T_ROID > .
    CALL METHOD<ref.var. to CL_GUI_ALV_GRID>->set_selected_rows
       EXPORTING
          IT_ROW_NO  =  <internal table of type LVC_T_ROID>
       or alternatively
       IT_INDEX_ROWS  =  <internal table of type LVC_T_ROW>
          IS_KEEP_OTHER_SELECTIONS  =  <type CHAR01>.
    http://help.sap.com/saphelp_erp2004/helpdata/EN/22/a3f5ecd2fe11d2b467006094192fe3/content.htm

  • Adding line item prior to ACC_DOCUMENT03 Posting

    Due to our legacy currency alignment on some systems being incongruent with our SAP ECC 6.0 environment, some upstream inbound IDocs will post with 2 decimals for HUF when 6.0 environment has 0 decimals for HUF.  The inbound documents are coming in as ACC_DOCUMENT03 IDocs.
    There will be rounding involved.  iN certain cases, the rounding will mean that the line items are no longer in balance.
    Rather than alter the value of the inbound line items, preference is to add line item prior to posting that contains the balance difference and posts to the "rounding difference" account.
    Has anyone expereinced this situation before? How was it resolved?
    Considered adding line item via "BAPI_ACC_DOCUMENT_POST" or, if possible, within "'BAPI_INCOMING_INVOICE_CREATE'".
    Has anyone faced this or a simlar issue before?  How was it resolved?  Was it resolved internally?

    Hello Weng,
    I also looked on SAP notes. 
    There is a note with much information about Tax Postings with accounting BAPIs and it's a consulting note.  The note number is 626235.
    Regards,
    Rae Ellen Woytowiez
    Edited by: Rae Ellen Woytowiez on Dec 21, 2010 10:11 PM

  • Logical standby issue after adding a new user at production db server

    Hello Experts,
    I am facing a issue related to logical standby db server where after adding a new user at production db server logical standby has stopped sql apply. Can anybody give some idea to find out the root cause and give some tips to resolve the issue.
    tried below .....
    SELECT EVENT_TIME, STATUS, EVENT FROM DBA_LOGSTDBY_EVENTS
    ORDER BY EVENT_TIMESTAMP, COMMIT_SCN, CURRENT_SCN;
    got error
    ORA-16227: DDL skipped due to missing object
    ORA-01403: no data found
    ORA-00942: table or view does not exist
    OS : RHEL 4 (IBM P5)
    DB : Oracle 10g (10.2.0.1)
    Achyot

    Please let me know if can skip the DDL at which it is failing.
    ALTER DATABASE STOP LOGICAL STANDBY APPLY;
    Use EXECUTE DBMS_LOGSTDBY.SKIP
    ALTER DATABASE START LOGICAL STANDBY APPLY;
    Thanks,
    Renu

  • Adding a domain user to Local Admin Groups using MDT 2012

    I don't know if this will help anyone, but it did me after weeks of searching.  If you are trying to add a domain user or domain groups to the local administrators group using MDT, simply go to the cs.ini and add "SkipAdminAccounts=No". 
    But the administrators accounts page will only appear if you choose to join a domain. 

    Correct, if you were to go into the %DeployRoot%\Scripts\DeployWiz_Definition_ENU.xml file you would see the entry for the DeployWiz_AdminAccounts.xml page as follows:
    <Pane id="AdministratorAccounts" reference="DeployWiz_AdminAccounts.xml">
    <Condition><![CDATA[ UCase(Property("SkipAdminAccounts")) = "NO" and UCase(Property("DeploymentType"))<>"REPLACE" and Property("DeploymentType")<>"CUSTOM" and Property("JoinDomain") <> "" ]]></Condition>
    </Pane>
    Most Wizard Pages are displayed by default, and you can turn them off by using the SkipXxxXxxxxx Page variable to hide them during wizard execution. This page is different, since it was added for MDT 2012, the MDT team decided to leave it *OFF* by default,
    instead you must explicitly turn off the SkipAdminAccounts variable by setting it to "NO".
    Additionally, you would not need to display this page if you were running a Refresh or a Custom Task Sequence.
    Finally, this page does not actually *create* accounts, instead it just adds pre-existing user accounts and adds them to the local Administrators group. This scenario is only valid when you are joining the machine to a domain, so you must Join to the Domain.
    If you are interested in adding other local users to the Administrators Group, you should write a script to create the account(s) and add them to the local group. Windows 8.1 has some *gotchas* that have to do with Microsoft Accounts, but that's a different
    Story :^).
    Keith Garner - keithga.wordpress.com

  • PO line level user exit

    Which is the PO line level user exit available?
    Please advice.

    HI.
      Goto se24 class builder ,
    Display the Class Cl_exithandler . There is a function name get_instance, Double click on it and pu a session breakpoint on the function METHOD cl_exithandler=>get_class_name_by_interface
    Now run the Transaction, it will be executed in the debugging mode and find the value of the variable... exit_name in it.
    You will get the exit name.
    regards,
    Kapil.

  • Adding a guest user

    How do I add a guest user and set it up so that the guest user can use X and all that.
    Also, when I start arch it goes directly to console. I like this as opposed to a log in manager. With the help of my fellow archers I added arguments to the xinitrc so that typing "xinit xfce" executes xfce4-session, "xinit X" starts an xterm, etc. etc. Upon starting up I get the login: prompt. Is there any way that I can make it say "type xinit xfce to use the gui, password for guest is blah". Just a small disclaimer to help people who have no idea how to use Linux but want to use my printer.
    I've added a guest user before but I could never get the guest user to be able to use X or anything. Any help would be appreciated.
    P.S. The guest user is only there because I have the only printer in the house and I don't want to give out my password. Adding a guest user would allow people to print when I'm away.

    absolutezero1287 wrote:The guest user is only there because I have the only printer in the house and I don't want to give out my password. Adding a guest user would allow people to print when I'm away.
    Are all the computerse in the house on the same network?  Would setting up your machine to allow other machines to use the printer over the network solve your problem?  The latter solution seems much better from many angles, though I don't know what other constraints you're working with.  If it does turn out to be feasible, check out samba (assuming the other machines are Windows) or cups.

  • Motion videos from captivate to .swf create visual noise - added lines

    There are a lot of added lines, field box outlines, etc. added to all my video portions on the .swf output.
    It's almost as if they are from a previous frame and just don't go away.  They're a little like a 'trail' mark from a previous frame in the video.
    Is there any setting I can change to get this to stop or how can I clean these up?

    Yes!  That did it - file size doesn't matter for me so this works.  Thank You

  • Added Lines not Totaling

    I have a Parts Estimate flowed form with a button to add more lines if needed. All the lines total correctly and total in the Total Estimate at the bottom on the page. But the added lines will not total on their own line, it just tabs over it.
    Everything else works fine but the subform added lines.
    I've looked the scripts over but not sure where I'm going wrong.
      Tks...
                HHud

    Hi HHud,  Are you using FormCalc or JavaScript?  You will need to cause the calculate event to fire again, either explicitly with execCalculate or referencing something in the changes like the instance managers count property.  You don't have to do anything with it, just referencing it will setup a dependency.  Bruce

  • Adding lines to segment of Idoc in User Exit ZXEDFU02

    Hi!
    do I need to maintain Idoc in WE30 if I need to add some lines to one segment in User Exit ZXEDFU02?
    Here is my sample code placed in ZXEDFU02 for adding a line, but it is not making an effect:
    WHEN 'E1EDP01'.
        CLEAR E1EDP26.
        E1EDP26-QUALF = '003'.
        E1EDP26-BETRG = 777.
    or maybe it depends on Idoc that I use in We19?
    For example, if Idoc that I use in WE19 for testing my User Exit does not has qualifier 003 in segment E1EDP26... could it be a reason?
    Will reward,
    Mindaugas.

    Hi,
           Saple Code:
    INCLUDE ZXEDFU02 *
    data: ls_ka1 like e1edka1,
    ls_edidd like edidd,
    l_lines type i.
    describe table int_edidd lines l_lines.
    check l_lines ne 0.
    read table int_edidd into ls_edidd index l_lines.
    check ls_edidd-segnam eq 'E1EDKA1' and
    ls_edidd-sdata(2) eq 'RS'.
    ls_ka1-parvw = 'ZC'.
    case xvbdkr-bukrs.
    when '1000'.
    ls_ka1-lifnr = '41010005823845840'.
    when others.
    exit.
    endcase.
    ls_edidd-sdata = ls_ka1.
    append ls_edidd to int_edidd.
    Regards

  • Creating SD schedule lines in user exit

    Hello,
    We are automatically creating schedule lines for a certain kind of SD document (scheduling agreement, VA31) in a user exit. We are inserting directly into internal table XVBEP.
    Creating those lines works. The values in VBAP and VBEP are exactly the same as if they were created manually, even though the confirmed quantity is only calculated when the document is saved. The requirements show up in MD04 for example.
    However, for some reason index table VEPVG is not updated accordingly. Any ideas what we're missing?
    Thank you
    Roland

    Found it myself. We didn't maintain the client field when adding new lines to XVBEP. This didn't matter for database table VBEP, but it did matter for index table VEPVG for some reason...

  • Repository Administration Utility - error while adding a new user

    Hello all,
    I'm currently experiencing some difficulties when I try to add a new user with the RAU tool. First I had problems installing the repository, in the CJSYSFOL stage (ORA-04063: package body "REPOS_MANAGER.JR_REG_IO" has errors). After granting execute rights on the UTL_FILE package, it seemed this problem was solved.
    However, the installation is finished and I wanted to add a user with the RAU. In user maintanance I added a user and then set all the properties. After clicking OK, the following error is generated:
    ORA-01919: role 'CKR_REPOS_MANAGER' does not exist
    ORA-06512: at "REPOS_MANAGER.JR_SYS_PRIVS", line 236
    Bladiebladiebla.
    Does anyone have a clue of what's going on here? And more important, how to solve this? Thanks for helping out!
    Greetings,
    Weis

    See if the "Check Requirements" gives you any issues to be solved or the "Object Status" utility. Seems like the role CKR_REPOS_MANAGER is not granted (directly - so not via a role).
    HTH
    Roel

  • Telephone Number field when adding a new User - CCM 4.2.1

    Is their a way to automatically populate the telephone number field for a user? BAT does not allow this field to be added to the spreadsheet (phones-users). Thanks.

    BAT Version: 5.2.1
    The DN is for the actual line number of the IP phone, not the telephone number field which is stored with the User infromation. These can be independent; for example, I might make a user's actual DN 40001, but want the telephone number in the CallManager Corp Directory to be 5179840001. So, I can place the E.164 number in the Telephone Number field under the User page in CCM. Then, when a user looks up the number using the Directories button on the IP phone, the full E.164 number shows up for that particular user search instead of the 5-digit number which is helpful for offnet dialing and overlapping dial plans among remote sites.
    So, I am looking for a way to automactically populate the Telephone Number field for each user (not the line number of an actual IP phone).
    Thanks.

  • "How to Line Items" - User Name giving RFC_ERROR_SYSTEM_FAILURE

    I have implemented the "How to Line Items" paper using Date and User Name.  When I created the function I just had 0DATE, created a planning modeler test scenario... Voila ... perfect.  I then when back and added 0UNAME to my cube, added the piece of code back into the class for user name, ran back through my planning modeler and now I am getting "Field symbol has not yet been assigned., error key: RFC_ERROR_SYSTEM_FAILURE"
    The short dump is occurring at "<l_chavl> = sy-uname" and says the following:
    This error may occur if
    - You address a typed field symbol before it has been set wit
      ASSIGN
    - You address a field symbol that pointed to the line of an
      internal table that was deleted
    - You address a field symbol that was previously reset using
      UNASSIGN or that pointed to a local field that no
      longer exists
    I looked in notes and 2 seemed to apply:  1057548 which seemed to follow my steps in creation, be we have implemented SP 15.  and 919850. 
    Could it be because the planning modeler has a fixed ABAP user entered in the BI_MODELDATA JCO destination and I am logging into the planning modeler with a different user ID so there is a conflict?  The short dump and the planning modeler created by shows XCOV775 but my login in XCOV673 for instance.
    Any help would be greatly appreciated.
    Cherie

    I don't understand what you are saying.  I used the How to Line Items code and just commented out some items.  This is what I have:
    FIELD-SYMBOLS: <l_chavl> TYPE ANY.
    fill ID
    ASSIGN COMPONENT 'BBP_OBGUID' OF STRUCTURE c_s_chas
                                    TO <l_chavl>.
    CALL FUNCTION 'GUID_CREATE'
    *IMPORTING
    ev_guid_32 = <l_chavl>.
    fill user - need to uncomment the bottom after adding in name.
    ASSIGN COMPONENT 'USERNAME' OF STRUCTURE c_s_chas
              TO <l_chavl>.
    <l_chavl> = sy-uname.
    fill date
    ASSIGN COMPONENT 'DATE0' OF STRUCTURE c_s_chas
                TO <l_chavl>.
    <l_chavl> = sy-datlo.
    fill time
    ASSIGN COMPONENT 'TIME' OF STRUCTURE c_s_chas
              TO <l_chavl>.
    get time field <l_chavl>.
    Edited by: Cherie Murphy on Feb 21, 2008 11:45 PM

  • How to allow only new combinations when adding lines in manual planning?

    Hello Xperts.
    in manual planning (input ready query called over web-template) the user wishes to plan (change the key figure values) for already existing combinations and to add new lines (which has been enabled in the web-template through a button group).
    The crux of the matter is that the user is supposed to be able to enter only new unique combinations of data. Hence the user may not enter already existing characteristic combinations as a new line.
    I have noticed that the system default is that if the user enters an already existing combination when "adding a new line", the value entered for the key figures is simply added to the existing value (summation) of that characteristic combination. This is unacceptable to the business requirements!
    I thought about solving with a check combination exit (CL_RSPLS_CR_EXIT_BASE), but the problem is that all already existing combinations would be invalid, hence it would not work I think.
    I would appreciate any suggestions out there how this could be accomplished. Thank you.

    Hi,
      The best option that satisfies your requirement is to create a custom planning function to accept only new combinations.
    For this check the following link,
    http://help.sap.com/saphelp_nw70/helpdata/en/43/0c033316cd2bc4e10000000a114cbd/frameset.htm
    In the above go to BI Integrated Planning -> BI Integrated Planning -> Implementing Planning Function Types
    After this, in your "Save" button on the workbook insert this custom function also before the "Save".
    So once you click "Save" button first check is performed and error is thrown if the records entered by the user are not as per your requirement.
    Regards,
    Balajee

Maybe you are looking for