Using list of names as input for script

Hi all,
I've written a script that creates a folder and sets the proper POSIX and ACL permissions based on the name I set (i.e. the username). What I'd like to do is have a list of usernames (possibly in a text file?) and perform the script for each of those users. How might I go about this? I'm including the script below in case that helps.
Thanks!
#!/bin/sh
USERNAME=1234567
mkdir /Shared Items/SharedFolder/$USERNAME
chown root:admin /Shared Items/SharedFolder/$USERNAME
chmod 770 /Shared Items/SharedFolder/$USERNAME
chmod +a "$USERNAME allow read,write,writeattr,readattr,readextattr,writeextattr,execute,list,search,delete,addfile,add_subdirectory,delete_child,file_inherit,directoryinherit" /Shared Items/SharedFolder/$USERNAME

I use sed to parse text files for this sort of thing. It filters out comments that begin with # and blank lines:
<pre style="border: 1px solid #ddd; padding-left: .75ex; padding-top: .25em; padding-bottom: .25em; margin-top: .5em; margin-bottom: .5em; margin-left: 1ex; max-width: 80ex; overflow: auto; font-size: 10px; font-family: Monaco, 'Courier New', Courier, monospace; color: #444; background: #eee; line-height: normal">sed 's/[:blank:]*#.*//; /^$/d' /your/users.conf | \
while read USERNAME; do
mkdir /Shared\ Items/SharedFolder/$USERNAME
chown root:admin /Shared\ Items/SharedFolder/$USERNAME
chmod 770 /Shared\ Items/SharedFolder/$USERNAME
chmod +a "$USERNAME allow read,write,writeattr,readattr,readextattr,writeextattr,execute,list,search,dele te,add_file,add_subdirectory,delete_child,file_inherit,directory_inherit" /Shared\ Items/SharedFolder/$USERNAME
done
</pre>

Similar Messages

  • Use virtual channel name as input to DAQmx Write? LV8 and DAQmx

    I've created a task for digital output that contains 8 named channels using the DAQmx Create Channel VI in Labview. Is it possible to use the channel name as an input to the DAQmx Write VI to reference the desired channel? I tried wiring a string with the channel name to the "task/channels in" input but I get a -200428 error that says the Value passed to the Task/Channels In control is invalid.
    The help "name to assign" input for the DAQmx Create Channel VI says
       If you use this input to provide your own names for the virtual channels, you must use the names when you refer to these channels
       in other NI-DAQmx VIs and Property Nodes
    OK, so how do you use the name assigned in other VIs?
    George

    George,
    I think that there may be some confusion here about the difference between local and global virtual channels.  First of all, please take a look at the following knowledge base:
    Physical Channels, Virtual Channels, and Tasks in NI-DAQmx
    As discussed in this KB, local global channels are created inside a task, and they only apply to that task.  In the help file for the DAQmx Write VI, the "task/channels in" description says "if you provide a list of virtual channels, NI-DAQmx creates a task automatically."  When you wire a string to this input, a new task is being created, and unless the channel name that you wire in is a global virtual channel (listed in MAX), you will get the error 200428 that you mentioned.  This is because that virtual channel that you are specifying is local to another task and is not associated with this new task. 
    One solution to this issue is to use the DAQmx Save Global Channel VI to save your local virtual channel as a global virtual channel before calling DAQmx Write.  Once this is done, you can then wire the same string constant to the "task/channels in" input of DAQmx Write or other DAQmx VI's. 
    The help text is still correct, but is only applicable in certain situations.  For example, if you create and name an analog input local virtual channel with DAQmx Create Channel, you could then use this channel name as the source input to a DAQmx Trigger VI configured for an analog edge start trigger.  You could also use that channel name as the input to the "ActiveChans" DAQmx Channel Property, which would enable you to modify the properties of that particular channel. 
    Hopefully this information is helpful to you.

  • Using multiple variable names in a for statement?

    I have searched, and I just can't seem to find how to do something, I do not have the code atm, but easy enough to explain...
    I have a GUI that has 3 rows of 3 fields...
    emp1Name, emp1Phone, emp1Fax
    emp2Name, emp2Phone, emp2Fax
    emp3Name, emp3Phone, emp3Fax
    I also have a tabbed file that has the input for each of these fields, it looks something like...
    Mike 602-111-1111 602-111-1112
    Dave 602-222-2222 602-222-2223
    Bethany 602-333-3333 602-333-3334
    Here is my method...
        private void getFile() {
            myFile = new File("C:/javainput.txt");
            msgField.setText("Welcome!");
            try {
                BufferedReader br = new BufferedReader(new FileReader(myFile));
                String s;
                while ((s=br.readLine())!=null){
                    String f[] = s.split("\t");
                    emp1Name.setText(f[0]);
                    emp1Phone.setText(f[1]);
                    emp1Fax.setText(f[2]);
                br.close();
            } catch (IOException e) {
                msgField.setText("INPUT FILE NOT FOUND!");
        }My question is, how do I cycle through emp1, emp2 and emp3 in a for statement. I tried empName, but that obviously isn't correct.
    Help, or point me to where I can read on this?
    Thank you!
    Edited by: 805764 on Oct 27, 2010 12:10 PM

    Do one thing at a time. First, define your Employee class. Compile it, debug it. Test it. Make sure that you can create Employees, set their names, phone numbers, etc., and get them back.
    Once that works, familiarize yourself with arrays, if necessary, completely separately from your Employee class.
    Once you're comfortable with arrays and with defining a new class (i.e., Employee), write a tiny test program that just, say, creates an array of a certain size and populates it with Employees, and then iterates over it printing out each Employee's information to the console.
    Once that works, set it aside. Now work on a GUI. Start by just displaying one or two hardcoded names and phone numbers. Once that works, add a bit more to it--say by getting that hardcoded information from inside Employee objects.
    And so on.
    Right now you're biting off too much at once. Keep working on one very small new step at a time, only move on to the next step once the previous one is solid, and do the steps independently of each other first, and then combine their respective results. It may sound like a lot of work, but I promise you, in the end, it's faster, easier, and far less frustrating to do it this way.
    At any given step, if you get stuck, post a question here, providing an [url http://sscce.org]SSCCE that shows what you're trying to do, and clearly explain exactly what problems you're having.

  • Using iPhone 4 as video input for iMovie

    Hey everyone,
    I've been wondering if it is possible to set up an iPhone 4 as the video input source for iMovie 11 so I can see on the Mac's screen what I'm pointing to iPhone at; to make sure it is in focus, etc. I know it's possible to set up other video cameras but I don't seem to be able to get the iPhone to work this way.
    Is it possible, or am I on to a loser here?

    Not possible. iMovie does not import from iPhone in real time. It will most likely be faster than real time based on how fast your Mac is.
    If you have a USB web cam or a FireWire tape DV cam, you may be able to do this. Thes importn in real time.

  • How to Use Detail Region in Table Input for Advanced Tables

    Hi, I have a requirement to have an editable table mapped to a VO with 30-40 fields.
    User does not want horizontal scrolling, so it is important to enable user input in the detail region of the advanced table
    The problem is whenever the detail link is clicked the table bean submits and validates the VO immediately even if there are required fields to be filled inside the detail region.
    How do I stop the table region from submitting everytime detail link is clicked?

    Note: There is not disable Server side validation in advanced table properties

  • "where used" list for query structures

    Hello Community,
    A structure is a re-useable BEx query object. I'm using the older version of BW 3.5, and we need to be able to identify the following :
    which structures have been used by a given query (using the query's technical name) ?
    which queries already make use of a given structure (using the structure's technical name) ?
    Any useful instructions would be so helpful.
    Thanks!
    Keith Helfrich

    Hi,
    You can get the where used list of the structures bu checking in query designer itself for where used list.
    Other option is : for both parts of your question you can get the infrmation from table RSZELTDIR.
    Here you will get the ELTUID . To find the relation between ELTUID and query technical name (COMPUID), check the my wiki below for exploring the relations below:
    http://wiki.sdn.sap.com/wiki/display/BI/ExploretherelationbetweenBEx+Tables
    -Vikram

  • Can i use a usb mic input for livestreaming

    I'm trying to livestream but theres no mic input on my iMac so could i use a usb-to-mic input for iMac. Thanks 

    You can use a mic with an 1/8th inch jack in the headphones port. You can also use one of those mics into a 1/8th to USB connector. You can also use a USB mic directly into the USB port.

  • Need help to find out the navigational attribute where used list ?

    HI all ,
    i have a 0BATCH_0PLANT  navigational attribute ,  i want to find out  , where it has been used in the all the queries  .
    Thanks ,

    Nav-attribute will also be see as a attribute in the system search for it and click on where used list of it.
    Search for the Info object 0BATCH_0PLANT. double click on it -- click on the where used list of the nav-attribute.
    It will display all the dependent objects where its used.
    With this you can get the IC,DSO,MP names where this object is used. next with the help of those MP,IC and DSO you can get the list of queries.

  • How do I use event.target.name in AS2?

    Thanks to kglad I was able to see how event.target.name in AS3 could make a button load a movieclip with the same namesake.
    I'm doing the same thing now in AS2 but don't know what to write instead of event.target.name.
    And so at the moment each button pushes info into an array and then a function uses that to decide which movieclip to attach to a holder after it has faded out once, and then fades in again...
    // ***** IMAGE GALLERY START ***** //
    // Add image to holder
    imgholder.attachMovie("img0", "image0_0", 1)
    // Array
    var nextLoad = ["img0"];
    // Btn listeners
    img5.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img5"); btnClick() } // Written on 1 line
    img4.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img4"); btnClick() }
    img3.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img3"); btnClick() }
    img2.onRelease = function() { trace (nextLoad); nextLoad.pop(); nextLoad.push("img2"); btnClick() }
    img1.onRelease = function() {
    nextLoad.pop();
    nextLoad.push("img1");
    btnClick()
    img0.onRelease = function() {
    nextLoad.pop();
    nextLoad.push("img0");
    btnClick()
    // The btn function
    function btnClick() {
    trace ("click");
    var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 100, 0, 1, true);
    myImgTween.onMotionFinished = function() {
    fadeOutImg();
    // The btn function part II
    function fadeOutImg() {
    trace ("fadeOutImg");
    imgholder.attachMovie(nextLoad, "image1_1", 1);
    var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 0, 100, 1, true);
    I know I should be able to push the button name into the array, but am having to use a string... I'm sure my code is cumbersome!! But it works. I've tried pushing the button name but it end up including the full stage reference.
    Is there a cleaner way of doing this using event.target.name?
    Thanks for looking!

    There is no event.target in AS2. However since AS2 has no way of remembering the scope object where the target object resides, you can use this to your advantage to retrieve the name of the target by using the "this" command in the function whenever you use the above format "mc.onPress = myfunc". FYI, the popular workaround Delegate, made it possible that when you called "this" in the function, you could retrieve the scope object where the target instance resides. So without its use, "this" will return the name of the target object. Anyway this is the code you can use:
    imgholder.attachMovie("img0","image0_0",1);
    var nextLoad = ["img0"];
    img5.onRelease = onImgRelease;
    img4.onRelease = onImgRelease;
    img3.onRelease = onImgRelease;
    img2.onRelease = onImgRelease;
    img1.onRelease = onImgRelease;
    img0.onRelease = onImgRelease;
    function onImgRelease():Void {
       nextLoad.pop();
       nextLoad.push(this._name);
       btnClick();
    // The btn function
    function btnClick() {
       trace("click");
       var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 100, 0, 1, true);
       myImgTween.onMotionFinished = function() {
          fadeOutImg();
    // The btn function part II
    function fadeOutImg() {
       trace("fadeOutImg");
       imgholder.attachMovie(nextLoad,"image1_1",1);
       var myImgTween:Object = new Tween(imgholder, "_alpha", Strong.easeOut, 0, 100, 1, true);

  • Change button name in a for-loop

    Hi all,
    I would like to implement a 'for loop' to add buttons to my panel depending on the value of max_number.
    The postion of these buttons will also change with each passing of the loop.
    The code below implements this. But when I click the buttons they only return the action listener of the last button drawn. This is because the JButton my_button is reused in each pass through the loop.
    What I need is to change the name of the button on each passing of the loop so that I create a new button each time with it's own unique action listener.
    Is there a way of adding/appending the value of 'i' to the button name each time the for loop is run?
    For example
    When i = 0 -> JButton my_button0 = ...
    When i = 1 -> JButton my_button1 = ...
    etc, etc,
    for (i = 0; i < max_number; i++)
    JButton my_button = new JButton(Integer.toString(i));
    my_button.addActionListener( new ActionListener()
    { public void actionPerformed(ActionEvent event)
    { do something depending on the value of 'i' }});
    addComponent(my_button, (2*i+1) , 4 , 1 , 1); //add newly created button to position x = (2*i+1), y = 4
    } //end for

    What?! Are you talking about the variable name? You can't, shouldn't, needn't use different variable names in a for loop, since the variables "expire" each time the loop is run. For instance:
    for(int i = 0; i < 10; i++) {
       //j doesn't exists even if this loop is on its 10'th lap!
       int j = i;
    }And you will have a problem with the ActionListener as well, since it depends on the "i" variable. "i" can't be accessed from an anonymous class unless it has been declared final, in which case it won't work for you.
    So: the my_button variable will contain a new JButton each time!
    Nille

  • Traceability with batch class characteristics in batch where used list.

    Hi,
    I have a process order which issues 5 pallets or material and produces 5 pallets of another material. Each pallet is a seperate batch in my scenario.
    All materials are assigned to a batch class and i will be using a class characteristic to enter the issued pallet number (includes material number and batch number)  to the produced pallet batch. This way i want to create a traceability system.
    the problem is i need a way to create a hierarchical view or integrate this scenario to batch where used list.
    there is a badi for where used list to read external data. but i guess that is for something called "external batches"
    can you please guide me for the best practice of doing this?
    Thanks,
    Alper,

    Hi!,
    I think you have to use the mix of two functionalities:
    1. Original batch function
    2. Batch derivation
    This way you can pull the characteristics of the source material batch in to raw material as well as finish material batches.
    In this you have to create a nonvaluated material which is used as original batch mateial. You have to assign this material in material master of the RM and FG alongwith other required entries.  Also you have to use batch derivation function to pull the charactristics of this original material batch in to the RM and FG.
    Please go through the SAP help regarding Original batch and Batch derivation function to have more clarity.
    Please revert back in case of any further issue.
    Regards,
    Uday

  • Where-used list

    Hi,
    After the upgrade from 46C to ECC 6.0 SR3, the where used list functionality does not work for some objects, while the same works in 46C. Any ideas? We are on Oracle 10.2.0.4.0 and solaris 10 in both environments.
    Thank You,
    Jiten

    Hi,
    from the upgrade guide....
    6.13 Updating the Where-Used List in the ABAP Workbench
    Note:
    This action is optional.
    As of Release 6.10, the where-used list for ABAP Dictionary objects and object types has changed. It
    now has an index of its own. If you need a complete display of the where-used list in your SAP system,
    you must recreate the index after the upgrade.
    Procedure
    To create the index, you need to run report SAPRSEUB in the background.
    Note
    As the runtime of the report may be quite long, we recommend that you run it in the development
    system only.
    For more information about this report, see SAP Note 28022.
    I suggest to you to run this program only in development system.
    Thanks.
    Kind Regards.
    Andrea

  • How do I prompt a user to enter in a string name and set it so it can be used as an input for a DLL

    I was having problems entering in a string name and setting it. Any suggestions.

    Entering the string is easy. Just use a string control.
    To setup the Call Library Function, right click on it and select Configure. Type in the path to the DLL (or use the Browse function) and then use the Function Name dropdown box to select the function within the DLL. From here, you have to setup the parameters. The return type parameter should already be selected in the Parameter drop down box, so click on the Type drop down box and select the type of parameter that the selected function will return. From there, click on the Add Parameter After button to add an input parameter and then select the type of parameter. Continue doing this for all of the input parameters to the DLL. For strings you'll see a new drop down box appear for String Format. Choose the
    format that the DLL expects.
    You need to know what the DLL is looking for. Have fun with it.
    Rob

  • Table name for BW Query Where used list

    Hi,
    I am looking for Table name where the information of  " where used list " of a BW query stores.
    Any help ?
    Thanks
    Satya

    Vani,
    I dont think it is available...
    whats your exact requirement???
    you can make use of these below tables
    RSZELTDIR              Directory of the reporting component elements
    RSZELTTXT      Texts of reporting component elements
    RSZELTXREF      Directory of query element references
    RSRREPDIR             Directory of all reports (Query GENUNIID)
    RSZCOMPDIR      Directory of reporting components
    RSZRANGE      Selection specification for an element
    RSZSELECT             Selection properties of an element
    RSZELTDIR              Directory of the reporting component elements
    RSZCOMPIC            Assignment reuseable component <-> InfoCube
    RSZELTPRIO      Priorities with element collisions
    RSZELTPROP      Element properties (settings)
    RSZELTATTR      Attribute selection per dimension element
    RSZCALC                    Definition of a formula element
    RSZCEL                 Query Designer: Directory of Cells
    RSZGLOBV            Global Variables in Reporting

  • Why can I not use the channel name, which is obtained from the function of DAQmx Task, as the input of the channel name for the function of Get Channel Information of DAQ?

    Why can I not use the channel name, which is obtained from the function of DAQmx Task, as the input of the channel name for the function of Get Channel Information of DAQ?

    Not a lot of details here, but my guess is this isn't working for you because you are wiring in the task to the Active Channels Property and not the actual Channel Name. I have attatched a screenshot of what I believe you are trying to do. The Task has 2 channels in it, so I need to index off one of the channels and wire it into the active channels input of the Channel Property node. Then I can read information about that channel
    Attachments:
    channel_name.JPG ‏69 KB

Maybe you are looking for