Question about unix script

Hi all,
I know this is not the question for this forum but in case :)) if somebody knows.
I have a shell script to run this completely I need to enter two times if I run it mannually. Now I want to automate that script and want to call that script from another script. Will anybody tell me how to automate 2nd carriage RETURN.
Thanks in Advance
Aqil

> It doesnot give me any error but it doesnt work.
When I asked "Does that work?" I meant does that approach work in general? i.e. can you ever have a background command as the subject of a here-document construction? I don't see how that could work, because once the command is kicked off in background in a separate process, how can you feed the rest of the input to it? It would make more sense to write
needcarriagereturn.sh <<END
END
) &or
function runmyscript
          needcarriagereturn.sh<<-END
          END
runmyscript &or perhaps
echo | needcarriagereturn.sh &Message was edited by:
William Robertson
Ignore the ">" character in the middle example. The forum software adds it for some reason.

Similar Messages

  • Question about calculation script 'Fix'

    Hi Guys,
    I have a question about calculation script 'Fix'. Below is the sample for my question:
    Dimension 'Period' has members '2009','2010','2011'. We want to Fix the data which 'Period' is not '2009'.
    From Database Administrator's Guide we could use @NOTEQUAL, but version 11.1.1.3.0 seems not support @NOTEQUAL.
    Actually, the dimension is dynamic so we cannot use the way fixing other memebers. What should I do for this requirement?
    Edited by: 842270 on Apr 24, 2011 7:29 PM

    842270 wrote:
    Hi Guys,
    I have a question about calculation script 'Fix'. Below is the sample for my question:
    Dimension 'Period' has members '2009','2010','2011'. We want to Fix the data which 'Period' is not '2009'.
    From Database Administrator's Guide we could use @NOTEQUAL, but version 11.1.1.3.0 seems not support @NOTEQUAL.
    Actually, the dimension is dynamic so we cannot use the way fixing other memebers. What should I do for this requirement?
    Edited by: 842270 on Apr 24, 2011 7:29 PMYou can use @Remove command to avoid 2009.
    @REMOVE
    Removes values or members in one list from another list.
    Syntax
    +@REMOVE (list1, list2)+
    Parameter     Description
    list1
    +     A list of member specifications, from which the members specified in list2 are removed.+
    list2
    A list of member specifications to be removed from list1.

  • Question about multiple Script declarations

    I'm reading Flash Builder 4 and Flex 4 Bible.
    On page 121 it states:
    "Any particular <fx:Script> element can contain nested ActionScript or use the source property to link to an external Actionscript file, but it cannot do both at the same time. You can, however, have as many <Script> declarations in a single MXML file as you need>"
    My questions are about the last sentence.
    1)  They specifically used <fx:Script> and <Script>. Are these two different entities?
    2)  I've never seen examples of using multiple <fx:Script> declarations in a project. How would this work?
    3)  Are they promoting bad practices by making this claim?
    Thank you
    Kristin

    Although multiple script tags are allowed, I'd guess that they're not commonly used.
    Gordon Smith
    Adobe Flex SDK Team

  • Question about simple script?

    Hello,
    I would like to write a small program/script and am looking for advice on how to do so. I do not have a preference about which method or language to use, hopefully looking for the simplest way to do this (if it works with Windows or DOS command line this is
    preferable).
    I have a program that runs on text files e.g. "program file1.txt file2.txt"
    I have 20 folders that each have 5-10 text files. I want to automatically get the name of the largest size text file from each of the 20 folders, and then run the program on these 20 files as described above.
    Ideally I could point my script to a folder, and it will automatically find the largest .txt file in each of the subdirectories and run "program file1.txt file2.txt file3.txt ..."
    Any ideas on how to most efficiently accomplish this? Ideas or links to tutorials if applicable are helpful.
    Thank you

    Yes this is very helpful, thank you so much. I have a couple of questions:
    What I am doing is actually running a perl wrapper that calls a java program, so my command looks something like this and it works fine if I enter multiple full path file names without quotes:
    perl Program C:\Folder1\Subfolder1\file1.txt C:\Folder1\Subfolder2\file2.txt C:\Folder1\Subfolder3\file3.txt
    The script as you described above does exactly what I am hoping for. For the $Path variable, I would like to either
    1) have this script begin from the directory that is it run from so if I copied it to C:\Folder1\ then it would run the command as shown above, or
    2) allow for a parameter to be passed to it with the path of the directory to begin from e.g. "powershellscript.ps C:\Folder1"
    How would I go about doing this?
    So I believe the last line of this script would be:
    perl Program ($Results -join " ")
    Does this make sense? If so I will give it a try. Thanks again.

  • Question about using script library

    Dear Mavens,
    I am writing a script that has lots of predefined text items because it deals with reprocessing certain javascript files.
    Here is an example from the beginning of the script (with the actual javascript code mangled because it seems to mess up the display):
    set sdinTXTcf_imgsrc to "<i_mg src=dfaasfaf"<P>
    set sdinTXTcf_onload to " onLoad="p_arent.frames[1].readystate(sfsafasfads"
    set sdinTXTcf_inBetween to "</d_iv>');
    } else {
    parent.frames[0].document.write('<div align="c_enter"><img src=\""
    this section is now getting quite long and I thought of putting it into an external file. What I was hoping to do is to load all these "set this to that" commands into my script then use them as if they had been defined in it.
    The following is a toy script to demonstrate my problem.
    I wrote a mini library which ilooks thusly:
    set var1 to "VAR1"
    set var22 to "VAR22"
    set var333 to "VAR333"
    Then a mini script that calls the mini library:
    load script file "whatever:toylib.scpt"
    get var1
    The result is
    tell current application
    load script file "whatever:toyscript.scpt"
    set var1 to "VAR1"
    set var22 to "VAR22"
    set var333 to "VAR333"
    "The variable var1 is not defined."
    setting up var1 as global does not help either, either in the scrip or in the library
    Now, I can set up the mini library script as a subroutine to be called, such as
    on toy()
    set var1 to "VAR1"
    set var22 to "VAR22"
    set var333 to "VAR333"
    return {v1:var1, v22:var22, v333:var333}
    end toy
    and in the main scipt I can do a
    set loaded to load script file "whatever:toylib.scpt"
    tell loaded
    set var1 to v1 of toy()
    end tell
    get var1
    which works but it is actually more cumbersome than simply having to scroll down dozens of lines of code on the top of the script.
    I'm sure I'm missing somethig here, your help will be appreaciated
      Mac OS X (10.4.8)  

    Hi Asu,
    There are several ways to do this. The easiest is to
    use properties. Your script library might look like
    this:
    property var1 : "VAR1"
    property var22 : "VAR22"
    property var333 : "VAR333"
    You might load it and get values like this as an
    example:
    set f to choose file -- the script to load
    set s_lib to load script f
    var22 of s_lib
    Note that this is not the only syntax.
    When you do things like 'set' in the script library,
    you need to run the loaded script or subroutines
    within it.
    gl,
    It worked. THANKS!

  • Question about PHP scripting

    i just did a PHP script for a web form, it works fine that
    when i press submit, it displays the page said "thanks for
    submitting," but the problem is i never receive the email of the
    data, any idea?

    I agree with GarryCT that you should try a simple test (no
    HTML) to see
    if you can send mail at all. If that succeeds, then try
    building it up
    to the point you're hoping for.
    When sending HTML mail, you /might/ want to consider
    including a plain
    text version and sending multi-part email.
    Anyway, here are some comments I have for the code posted
    here:
    Try
    temporarily turning on display errors.
    > <?php
    ini_set('error_reporting', E_ALL);
    ini_set('display_errors', 1);
    > /*subject and email variables*/
    > $subject = 'php scripting';
    > $me = 'my email';
    > /*gathering data variables*/
    > $name1 = $_POST ['name1'];
    > $name2 = $_POST ['name2'];
    > $email = $_POST ['email'];
    > $company = $_POST ['company'];
    > $brief = $_POST ['brief'];
    >
    > $body = <<<EOD
    > <br><HR><br>
    > First Name: $name1 <br>
    > Last Name: $name2 <br>
    > E-mail Address: $email <br>
    > Company: $company <br>
    > Brief: $brief <br>
    > EOD;
    Hopefully, that indent was caused by the Web forum.
    Otherwise, EOD;
    should be at the very start of the line - no white space[1].
    EOD;
    > $headers = "From: $mail\r\n";
    You have not assigned a value to $mail. Some hosts require
    this to be
    an address in your domain. Try using your $me variable here
    (assuming
    it is a valid email address from this domain).
    > $headers .= "Content-type: text /html\r\n";
    Try removing that extra space. You might also need to add
    mime
    version[2]. Does order make a difference? Try this for the
    $headers
    variable:
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' .
    "\r\n";
    $headers .= "From: $me\r\n";
    > $success = mail($me, $subject, $body, $headers);
    You are not acting on the TRUE/FALSE result stored in
    $success.
    Everything after this point assumes mail was accepted for
    delivery. Of
    course, TRUE does not necessarily mean the mail actually got
    to its
    intended destination[2], FALSE does indicate that it was not
    delivered
    at all.
    > /*results rendered as HTML*/
    > $theResults = <<<EOD
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN"
    > "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    > <html xmlns="
    http://www.w3.org/1999/xhtml">
    > <head>
    > <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    > <title>Untitled Document</title>
    > </head>
    > <body>Thanks for your time, we'll get back to you
    within a day.
    > </body>
    > </html>
    > EOD;
    Hopefully, that indent was caused by the Web forum.
    Otherwise, EOD;
    should be at the very start of the line - no white space[1].
    EOD;
    > echo "$theResults";
    > ?>
    [1]
    http://php.net/echo (see "here
    document" in examples.)
    [2]
    http://php.net/function.mail
    Mark A. Boyd
    Keep-On-Learnin' :)

  • Question about fx:Script

    Hi,
    I have a form using many functions of calculations in fx:Script.
    Can I create a separate file with part of my fx:script? it is getting to long.
    If I can separate this file, can I use this in a different form?
    Thanks!

    You can use the source property:
    <fx:Script source="scripts.as"/>

  • [SOLVED]A simple question about bash scripting

    Just for fun, I thought I'd try making Arch as "parent friendly" as possible (i.e., easy to use once set up).  I've already made a nifty little "system maintenance" script that presents you with a "select" bash menu, with options being "Install, Remove, Update [Without AUR, with AUR, abs, exit], Search, Install and Search (using Yaourt), and exit"
    That works wonderfully, and it only requires typing "sm" into the terminal.
    But just to make it yet *more* "parent friendly", I thought I'd make a .desktop file.
    This is the problem.
    I want the shortcut to essentially open up the script in a terminal.  So it would have to execute, say, "xterm" and then open the "sm" script within the called terminal.
    I believe this would mean I need to either add something to my "sm" script or make a new script that opens terminal and calls sm.
    I'm sure this has an easy solution, but I'm a total amateur just having some fun.
    Any suggestions?
    Last edited by hwkiller (2010-07-13 00:32:48)

    I am not a 100% on .desktop files since I never use them.
    but if your command in the desktop file is something like
    xterm -e /path/to/your/sm/file
    that should work.
    EDIT: Bah too late !
    Last edited by Inxsible (2010-07-12 19:27:11)

  • A question about action script 2

    hi all , i do a game with as2 (its an escape game) i have stuck somewhere in as 2. if u help me i will be glad.İ am begginer at flash yet pls help
    i use this code for i take the item to my inv:
    its object code in my inv:
    onClipEvent (load) {
                this.tabEnabled = false;
                this._visible = false;
                orig_x = this._x;
                orig_y = this._y;
    on (press) {
                this.startDrag();
    on (release) {
                this.stopDrag();
                this._x = orig_x;
                this._y = orig_y;
    if (eval(this._droptarget) == _level0.yuk) { 
                            _global.lantern = 1;
                            this._visible = false;
      _level0.gotoAndStop(5);
    its normal object code:
    onClipEvent (load) {
                this.tabEnabled = false;
                if (_global.lantern == 1) {
                            this._visible = false;
    on (release) {
                _global.lantern = 1;
                this._visible = false;
                _level0.lantern_inv._visible = true;
    problem is that my objects doesnt show everyframe in my inventory.
    e.t.c. in frame 1:i take object to my inventory but in second frame:it doesnt show in inventory i wanna player can take object his inv and use it other rooms in my game  didnt able to solve the prob. with layers if u help me i will be glad.
    (sorry for eng)

    i solved problem with that:
    i used variables and after that i dont see two times to my objects at any frame.Coz variable was work.i did keyframes my all frames at layers.Last time i deleted my objects from other frames
    finally:i take one object from 1st frame , use it at 3th frame.Works for now thanx for help
    if i paste my codes to timeline it says:this codes only work for movie clips e.t.c. problem solved for now i hope.
    i like you all ! alwayz need your help

  • A question about SAP script

    Consider a main window, can its width & length be changed/different with first page?

    Most of the time main window in first page will have diffrent position and second page onwards it will have diffrent position .
    one example :
    sales order details - want to print layout form
    requirement will be customer address should be in first page and body will be in first page and next page also.
    first page - we will print customer address and body
    next page onwards we will not print customer address and main window will have more space ,so here we need assign diffrent position.

  • MS/UNIX/DB question - How to find MS characters in Unix scripts.

    Hi. I apologise if this is a bit off-topic.
    We have been developing sql scripts on PC's but need to run them from UNIX. We are find Microsoft characters like double spaces followed by a dash convert into little squares and upside down question marks. etc.
    I can find them in the database using:
    SELECT description_text, dump(description_text)
       FROM descriptions
      WHERE regexp_like( description_text, '[^[:print:][:space:]]');And get things like "Adjustment � Service".
    In unix that might appear as "\266" in the middle of a text string. We find them in the db, fix them, and re-deploy.. but this is getting tiresome.
    I want to be able to repeatedly scan all sql scripts in Unix, including files in subdirectories. (there are literally hundreds..)
    We're running SunOS 5.10. I have tried "grep -r {266}" but the -r option isn't valid with my version of grep... :(
    Any suggestions about the easiest/most pragmatic way of doing this?
    Thanks in advance. :)
    Pete
    Edited by: peetmoore on 11-Aug-2009 19:51

    I couldn't get the shell script to work, so just kept playing with command line.
    The closest I have is:   find . -name "*.sql"  | xargs  grep 'xyz' Or using od: find . -name "*" | xargs | od -c | grep 'xyz' But i'm struggling a bit to identify and filter the specifc characters i'm looking for. They appear differently depending on how they're being viewed. (or not at all.) in some cases 2 spaces following by a dash " -" appeared as an update down question mark in Sql and "\266" in the unix script when viewed in vi. I don't have any current examples so it's hard to see what it looks like in od.

  • Question about DBCA generate script o create RAC database 2 node cluster

    Question about creating two node RAC database 11g after installing and configuration 11g clusterware. I've used DBCA to generate script to create a rac database. I've set
    environment variable ORACLE_SID=RAC and the creating script creates instance of RAC1 and RAC2. My understanding is that each node will represent a node, however there should only be one database with a name of 'RAC'. Please advise

    You are getting your terminology mixed up.
    You only have one database. Take a look, there are one set of datafiles on shared storage.
    You have 2 instances which are accessing one database.
    Database name is RAC. Instance names are RAC1, RAC2, etc, etc.
    Also, if you look at the listener configuration and if your tnsnames is setup properly then connecting to RAC will connect you to either one of the instances wheras connecting to RAC1 will connect you to that instance.

  • Simple question about mount and delay script

    Hello, I have a simple question about mounting volumes on start up.
    My computer wakes up auto - and then auto there are serveral applescript tasks (mount and start up programs)
    I use this script (daily) for serveral connections with external volumes I always need the connect to. ( In the script I use this code 3 times for other locations) I do this on start up.
    set Uname to "XXX"
    set Pword to "XXX"
    set someVolume to "afp://XXX.XXX.XXX.XXX/XXX/XXX
    mount volume someVolume as user name Uname with password Pword
    (same code for 2 other locations)
    When i do this on start up sometimes the script says there is no connection possible. I guess it's because on start up the connection isn't there. And 1 minute later when computer is total ready the connection is ok. When I run the script then It works. Just sometimes ( In the morning) 'It' want to connect but the script stops. When i do it manually(I run the script again) it works just fine.
    Is it possible that I need a delay? Can someone explain this?
    How would I make a delay handler for this script? Is that the best solution?
    Thanks in advance. This is something small i'm wondering about.
    Colin

    BTW, If you saved the script as an application +(and not as an application bundle)+ you could drop the script on to *Drop Script Backgrounder* (freeware).
    Then the script would run in the background, so, you wouldn't see it running in the Finder.
    <http://www.macupdate.com/info.php/id/7922/drop-script-backgrounder-x>
    Tom

  • Basic Questions About Compiling Source

    Hi!
    I have some very basic questions about compiling source on 10.6. BTW, if the unix discussions still exist, they've hidden them pretty well, so I hope I'm in the right place for this!
    First off, you simply cd to the source dir, wherever it may be - in my case ~/Downloads/source/  - and during the install process, everything will be installed in its proper dir, right?
    How do you know which compiler to use? There seem to be several: make, gmake, gcc, g++, etc...
    Once you do figure out which compiler to run, the process is supposed to go like this, right?
    ./configure
    make (or whatever)
    make install
    But this doesn't always work for me. For instance, I'm trying to compile 'arm', but it doesn't seem to have a 'configure' script.
    $ ls ~/Downloads/arm
    ChangeLog
    README
    armrc.sample
    setup.py
    LICENSE
    arm
    install
    /src
    Maybe it's that 'setup.py' file? What are you supposed to do?
    Of course, it's not only this one that's given me trouble. Sometimes the readme will say I have to edit a certain file for my system. Are there just a few standard changes you always make? Or is it...how can I put it...complicated? How do you find out what's needed in those cases?
    OS 10.6.8
    Xcode 3.2.4
    Python 2.7

    sudont wrote:
    I have some very basic questions about compiling source on 10.6. BTW, if the unix discussions still exist, they've hidden them pretty well, so I hope I'm in the right place for this!
    This is the place for UNIX discussions. If you have developer-related questions, there is a forum dedicated to that as well: Developer Forums
    First off, you simply cd to the source dir, wherever it may be - in my case ~/Downloads/source/  - and during the install process, everything will be installed in its proper dir, right?
    Yes. Hopefully the project you want to install follows standard conventions. If so, you can do "./configure", then "make", and finally "sudo make install" to install the software into "/usr/local".
    How do you know which compiler to use? There seem to be several: make, gmake, gcc, g++, etc...
    The make file will figure that stuff out.
    Once you do figure out which compiler to run, the process is supposed to go like this, right?
    ./configure
    make (or whatever)
    make install
    Yes, with the addition of "sudo" before "make install" because "/usr/local" is owned by root.
    But this doesn't always work for me. For instance, I'm trying to compile 'arm', but it doesn't seem to have a 'configure' script.
    $ ls ~/Downloads/arm
    ChangeLog
    README
    armrc.sample
    setup.py
    LICENSE
    arm
    install
    /src
    arm? You mean "arm (anonymizing relay monitor) - Terminal status monitor for Tor relays." You really don't want to be messing with that stuff. The only people involved with Tor that are trustworthy are US Navy intelligence who have their own uses for it. If you don't understand it as well as they do, best stay away.

  • A Question about LV Database Connectivi​ty Toolkit

    Hello everyone!
    I have a question about using LabVIEW DataBase Connectivity Toolkit 1.0.2 that eagerly needs your help. I don't know how to programmaticlly create a new Microsoft Access(.mdb)file (Not a new table in a existing Database)using LabVIEW Database Connectivity Toolkit1.0.2. As you know, usually we can set up the connection by creating a Universal Data Link (.udl) file and inputting the path to the DB Tools Open Connec VI in the LabVIEW DataBase Connectivity Toolkit. However, searching a table within an existing database containing a great many tables is a toilfulif job. If I want to use a new DataBase file with the date and time string as its name to log my acquisition data in each measurement process, how to do? I am sure someone of you must can resolve my question, and thanks very much for your help.

    I don't know what your real design considerations are here but, from I understand from your post, this is a really bad way to go about the process of logging data -- IF you want to be able to do significant ad hoc or stored procedures analyses after it has been collected.  Using separate MDB files for data that ONLY differs by one field (namely that date) is not the most efficient way to organize it.  What would be much more efficient would a joined table including the date and a reference ID of some sort for the various measurements that were done.  That way your stored procedures for looking at ALL measurements of type X would be very simple going across ALL dates.  Making such a comparison across multiple MDB files is a much more challenging process AND doing the original data collection in that way doesn't really gain you anything.
    Generally, if something is difficult to do in the DCT (Database Connectivity Toolkit) it's because it's a "not good thing" to do within MDBs.  I know that others probably disagree with that but I've worked with Access since it's initial release and other RDBMs prior to that both through compiled tools, Unix scripts, etc.  You may, of course, still choose to proceed in the way you've described and that may work excellently for you. 

Maybe you are looking for

  • Not able to install Adobe Flash Builder in windows xp 32 bit OS. Getting error msg 64 bit required.

    Hi All, Not able to install Adobe Flash Builder 4.7 in windows xp 32 bit OS. Getting error msg 64 bit required. Pls help me for installation. thanks in advance.

  • E72_SIM Card register fail problem

    Dear All   I just buy nokia E73 about 1 week. It has a problem with my phone ,It push a message to notify that SIM card register fail. Since I use my phone 1 week , it notify every day that I solve it by turn off phone and turn on again after that it

  • Account Number for a Kanban requisition

    Have an item with an expense account # 1234 at the org item. A requisition gets created from a Kanban replenishment. The requisition pulls in the expense account number from the subinventory. THoughts to as why that happens?

  • CRM Contract with Status "Completed" Not Replicated

    Dear CRM experts, We've noticed that, when we create a CRM Contract in the CRM system and changed its status to "Completed" before saving it, the Contract does not get replicated to the back-end R3 systems. However, when we create a CRM Contract with

  • Can't find my templet library in Encore

    I was following a turorial on Adobe TV about making menus in Encore and when they came to opening templets in the library, I find that I have no library. I have looked everywhere and just don't seem to have a library. Would reloading the program help