Piped reader

Hello everyone
can any one explain to me how to use pipedreader and pipedwriter
can i open a text file change it using some methods and rewrite it to another text file using these two methods ( pipedreader and pipedwriter ) or one of them
thanks for helping me

Do you have a problem that you need a solution to or do you just want to know why one would use those classes?
If the first then post the problem. If the second then the first step would be to google for examples.

Similar Messages

  • Hello. I want to use my iphone as a viewing screen for a usb endoscope, (its a small camera on a long cable for inspecting down piping and such) with an app is it possible to attach the usb to my iphone using a adapter to watch the live video feed on th

    Hello. I want to use my iphone as a viewing screen for a usb endoscope, (its a small camera on a long cable for inspecting down piping and such) with your app is it possible to attach the usb to my iphone using a adapter to watch the live video feed on the iphone?
    Thankyou.

    Hello. I want to use my iphone as a viewing screen for a usb endoscope, (its a small camera on a long cable for inspecting down piping and such) with your app is it possible to attach the usb to my iphone using a adapter to watch the live video feed on the iphone?
    Thankyou.

  • How to read unix standrad pipe output stream

    I want to write some code that will read data from a standard solaris pipe output stream. Please help.
    For example
    I cat a file in a unix shell
    cat /etc/hosts
    The output of this file can be piped to another program and I want to write a piece of code that reads that piped data and puts it into a textArea.
    Thanks

    Here ya go bro.................
    This just checks if IO is coming in and if so prints it to the term, but
    you get the idea.
    There might be an better way but...........
    import java.io.*;
    class xxx
    public static void main(String args[])
    byte b[] = new byte[256];
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    try {
    if(System.in.available() > 0) {
    System.in.read(b);
    baos.write(b,0,256);
    System.out.println(baos.toString());
    else
    System.out.println("No pipe being layed");
    catch(Throwable t){}

  • Want to Read the a txt file and put the data into the table colums.

    I have a text file in which data is piped separated and I want to put the data in the table column.
    Eg.
    Text File Column
    First_name|Last_name|address|phone_number
    Database table:
    first_name ,last_name,address,phone_number
    It's very urgent.
    Thanks For your help in advance.
    Himanshu

    Use sqlldr or external file.
    See http://download.oracle.com/docs/cd/E11882_01/server.112/e10701/part_ldr.htm#i436326 for SQL Loader.
    See http://download.oracle.com/docs/cd/E11882_01/server.112/e10595/tables013.htm#ADMIN11705 for External table.

  • [Sound] Read In From System Out

    I've written a Java program to take sound input from a microphone and run an FFT on it for frequency analysis. It works, and works smashingly well, I might add.
    Now, I need it for a different purpose. I'm looking to run it against the sound currently coming OUT of my computer. My current solution is to quite literally take my microphone and put it up against my speaker. It works, but is a rather silly way of doing it. I'm looking to do the same thing in software. The sound that I'm looking to gather is NOT coming from Java, it's coming from another application in Windows.
    I don't know how to phrase the question in more tech-speak, sorry. Probably something about piping a TargetDataLine to a SourceDataLine or vice-versa. I'm more than willing to poke around in the API for hours on end, but I'm going to feel awfully silly if my answer ends up being "You can't do it any other way than what you're already doing."

    Ahhh...I figured out how to do it in Windows, when you double-click on the Speaker icon and go to Properties, Recording, and select the right source. I actually knew how to do it before, but when I tried it and it didn't work, I figured Java was too smart for that and was still looking at the microphone. Turns out, I just didn't have all the different "sources" available (in the Properties) menu, and hadn't picked the right one. Works flawlessly.
    I am, however, still very much curious if there is a way to achieve the same effect entirely within Java.
    Thanks.

  • Reading content to insert into a database for file content searches

    I have a new challenge that has been brought to me.
    There is and existing application that has files being inserted into the database and the customer is having great difficulty in being able to have a search capability against those files. I was thinking that I could do a secondary lookup before the file is actually uploaded and there would be use of the cffile to read the file then insert that data from the read and insert that data into a column of that database the equiled that record. The most important part of this is that the file's content is read from cffile and inserted into a column that actually get's that data into the RBDMS system that will allow for a full text search that would point to that system.
    Any other ideas of how to insert document content into a data record other than using the cffile tag would be most appreciated.
    Thanks in advance.
    Gene

    Most, if not all, database management systems have their own features to read text data from files.  You may prefer that functionality over piping the data through ColdFusion and the database drivers.
    <cffile...> can "read" .doc and .pdf file as in it can read the file from the file system as the binary data they are, but that does not extract the text from the content.  You can do some stuff with CFML to read the text in a pdf file with the <cfpdf...> and related tags and functions.  I'm not aware of similar CFML features that work with doc files, but I know of Java tools that do such as POI.  These are usually fairly straight forward to tap into with ColdFusion.

  • How to run piped Unix commands

    Hi,
    I'm trying to run piped Unix commands using Runtime.getRuntime().exec(...) but apparently the pipe symbol ("|") doesn't seem to work...
    Here is basically what I'm trying to do: running "command1 | command2" where both "command1" and "command2" have dynamic values. I could create a shell script and execute it through Java but there has to be a cleaner way...
    Can anyone help me with this?
    Thanks,
    Thierry

    The | symbol for a pipe is understood by a shell, so it was right to point to this direction.
    If you still have a problem, that might be because of another reason. What did happen, how exactly� did it not work? Did you take care of the stdin and stdout channels of the launched process?

  • Piping script line in a powershell script

    Hi,
    I would like piping informations in a powershell script and getting this:
    If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
    $arguments = "& '" + $myinvocation.mycommand.definition + "'"
    Start-Process powershell -Verb runAs -ArgumentList $arguments
    Break
    [string]$scriptDirectory = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent # Emplacement du script
    powershell.exe -executionpolicy bypass -File $scriptDirectory\Vcredist2005_Frv1.ps1 install
    =====================================
    ======================================
    My script is looking this:
    $var_InterventionManuelle ="c:\temp"
    $var_FichierLancementManuelle = "install_Man.ps1"
    $var_EmplacementFichierLancementManuelle ="c:\temp\install_Man.ps1"
    New-Item -path $var_InterventionManuelle -Name $var_FichierLancementManuelle -type file
    Add-Content -path $var_EmplacementFichierLancementManuelle -Value "`nIf (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))"
    Add-Content -path $var_EmplacementFichierLancementManuelle -Value "`n{"
    Add-Content -path $var_EmplacementFichierLancementManuelle -Value "`n$arguments = ""&" '" + $myinvocation.mycommand.definition + "'""
    Add-Content -path $var_EmplacementFichierLancementManuelle -Value "`nStart-Process powershell -Verb runAs -ArgumentList $arguments"
    Add-Content -path $var_EmplacementFichierLancementManuelle -Value "`nBreak"
    Add-Content -path $var_EmplacementFichierLancementManuelle -Value "`n}"
    Add-Content -path $var_EmplacementFichierLancementManuelle -Value "`n[string]$scriptDirectory = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent"
    Add-Content -path $var_EmplacementFichierLancementManuelle -Value "`npowershell.exe -executionpolicy bypass -File $scriptDirectory\$var_Scriptactuel install"
    It is failing on the first add-content. Where am I wrong? Is it an easier way to do this?
    Thanks,
    François

    Hi,
    If all you're trying to do is write all of that to a file, you can do something like this:
    $text = @'
    If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
    $arguments = "& '" + $myinvocation.mycommand.definition + "'"
    Start-Process powershell -Verb runAs -ArgumentList $arguments
    Break
    [string]$scriptDirectory = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent # Emplacement du script
    powershell.exe -executionpolicy bypass -File $scriptDirectory\Vcredist2005_Frv1.ps1 install
    $text | Out-File .\script.ps1
    Here's some information about here-strings:
    http://technet.microsoft.com/en-us/library/ee692792.aspx
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • System("read") command

    Hello. I've got the following code in a program:
    printf("%s", "the text that I want to print to the console");
    system("read");
    The purpose here is to have the text from the printf( ) statement above print to the console, and then have the program pause and wait for the user to hit any key (note that scanf( ) or other input functions are not appropriate here for two reasons: first, the keys the user hits actually appear on the console, and I don't want them to, and second, the user can type many, many keys and the program will not continue until he or she hits Enter -- I want the program to simply pause until any key is hit). I knew that with C++ on Windows I used to be able to achieve this perfectly using system("Pause"), but I found that this did not work with C on the Mac. Thanks to help from RayNewb and Cohi in a previous thread, they explained that system( ) was a stdlib.h function that could easily be used in C, and that I just needed to find the Unix-equivalent of the "Pause" command (which was a DOS command, which is why it wasn't working on the Mac). Ray and Cohi came up with the following statement to replace the DOS-oriented system("Pause"):
    system( "read -n 1 -s -p "Press any key to continue..."; echo" );
    As you can see from the code at the very top of the post, I ended up shortening this statement to simply system("read") because I found that, for my purposes at least, it did the exact same thing as the longer version shown directly above. In either case, they were right about this command, and this statement did exactly what I wanted it to, except for one problem...
    Gievn the two statements at the top of the post, the expected result would be for the text from the printf( ) statement to print to the console, followed by a pause in the program waiting for a key to be hit, at which point the program would continue. This is exactly what happens, only backwards. The program starts off with a pause, waiting for any key to be hit, and when a key is hit, only then does the printf( ) statement run and the text appear on the console. This happens whether I use the short version of the "read" statement or the full version that Ray and Cohi came up with. Can anyone help explain this? Any help is greatly appreciated.

    Tron55555 wrote:
    I know the fprintf() function, but I thought it was only used to write to files
    Important plot point - everything is a file.
    What is it that allows "stdout" to be used in place of a file name in this function's argument? Since "stdout" is a pointer like you said, does that mean that any pointer could be used for the first argument in the fprintf() function, not just file pointers? How's that work?
    fprintf doesn't take a file name. It takes a "FILE *". You can create one of those with "fopen()" or you can use the pre-defined ones for standard input, output, and error. You can use any valid "FILE *" for the argument.
    Do you guys have any recommendation of which would be better (whether it would be better to use fflush(stdout) or fprintf(stderr, "") )? Is one of these solutions more appropriate than the other, or are they both the same in effect?
    Neither. Don't write command-line tools that depend on the terminal. fflush(stdout) is more tedious to use in the code, but more robust. Otherwise, you would have some of your output going to stdout and some of it going to stderr, which becomes a hassle. But it is only a hassle when you are dealing with command-line tools that are using the command line as an interface, and those things are always a hassle. It is better to stick to stdout and then you can more easily pipe the output of one program to the input of another. If you are going to break that functionality, you might as well write a real GUI. If you do your command-line tool correctly, you can easily write a GUI wrapper for it and have both GUI and good command-ilne functionality.
    I don't really know anything about this stuff, but you mentioned that it's generally a bad idea to write command-line apps that have dependencies on the Terminal. Do you know of any other way to achieve the type of pause I'm trying to achieve without using the Terminal?
    No. If you want to have a user interface, you have to interact. Unix was designed around the idea of a toolbox of simple programs that can be combined (piped) together to do clever things. You shouldn't have a requirement for terminal interaction. The basic functionality should be entirely driven by the command line so your tool could be easily used by other tools. If you really want an interface, add one, but require a "-i" flag to trigger interactive mode or maybe use "isatty()" to find out automatically (The "i" flag would be more robust though).
    Consider the shell itself. It is, by definition, an interactive program. Right? Wrong. It can be run non-interactively too. In fact, non-interactive behavior is the default.
    I've heard of them before, but don't know anything about them. If anyone has spare time, could you give me an explanation of what they do (doesn't have to be anything in detail -- just tyring to get some really basic idea of what they are, and what all the fuss over them is about). Thanks for your reply, eric.
    It is an easy to use library for (fully) interacting with the terminal. It was a bigger deal before everyone had graphical user interfaces. There are umpteen different kinds of terminals and configurations and curses knows them all. You can even do text windows. Still, it is "easier" than interacting with the terminal, but only because the terminal is so cryptic.
    Tron55555 wrote:
    P.S. -- on a separate note, can anyone tell me, when formatting a quote on these forums, how I can write who's quote is it? When the quote says, for example, "etresoft wrote..." -- how do I do that? I checked the Help section under How to Format Text, but it didn't have anything about quotes. Thanks.
    etresoft wrote:
    Just hit the "quotes" button and see how the forum does it.
    "Abraham Lincoln" wrote:
    Four score and seven years ago...

  • Piping into pager (less) from C program

    I am trying to write output to "less" from a C program to allow paging.  I have tried using popen (3), similar as in the following simple test program:
    #include <stdio.h>
    int main(int argc, char **argv)
    FILE *out;
    int i;
    out= popen("/usr/bin/less", "w");
    for( i= 0; i< 512; ++i )
    fprintf(out, "This is line %d\n", i);
    pclose(out);
    This mostly works, but behaves differently from other programs that do the same thing.  In particular, you cannot use Ctrl-C to stop skipping to the end of the output without killing both less and the original program.  (Apparently less normally catches the signal, but is prevented from doing so when I start it as above.)
    Both when typing "| less" in the shell and when using "man", this works.  I have looked at the output of pstree and noticed the following differences:  When piping into less from the shell, the less process is a child of the shell, so this is clearly different from what I can get with popen().  But when man is running, the less process is also a child of man, but it still behaves correctly.
    Has anyone done this kind of thing before or has any ideas?

    You want to play with pipe/fork:
    #include <stdlib.h>
    #include <stdio.h>
    #include <unistd.h>
    void work(void) {
    int i;
    for (i=0; i<512; i++) {
    printf("Line %d\n", i);
    int main(void) {
    int pfds[2];
    pid_t pid;
    if (pipe(pfds) < 0) {
    perror("pipe failed");
    return EXIT_FAILURE;
    pid = fork();
    if (pid < 0) {
    perror("fork failed");
    return EXIT_FAILURE;
    } else if (pid == 0) { /* child */
    close(pfds[0]); /* close unused read end */
    /* set write end of pipe as stdout for this child process */
    dup2(pfds[1], STDOUT_FILENO);
    close(pfds[1]);
    work();
    } else /* if (pid > 0) */ { /* parent */
    char *args[] = { "less", NULL };
    close(pfds[1]); /* close unused write end */
    /* set read end of pipe as stdin for this process */
    dup2(pfds[0], STDIN_FILENO);
    close(pfds[0]); /* already redirected to stdin */
    execvp(args[0], args);
    perror("exec failed");
    exit(EXIT_FAILURE);
    return EXIT_SUCCESS;
    Hint for the future, you can use strace to observe how programs work. For pipes:
    strace -o log.txt -f sh -c 'echo 1337 | less'
    (`-o log.txt` writes to that file, `-f` takes forks into account)

  • Help ,ImageIO exception to read and write

    Hi,
    I'm dynamically creating image files through screens utility of java(prog name:- Test_ScreenShot.java) and saving
    them in memory sequentially(pic0.jpg,pic1.jpg....etc).Simultaneously I'm accessing the saved files from another
    independent application(Prog name:- Test_Main.java) through piping(executing the application like this "Java
    Test_Screens|Java Test_Main").The application is in infinite loop.I'm using Version JDK 1.5
    I use java Image to read and write image:-
    My application was running well for days.But now I'm getting sudden exceptions.
    I got an exception while trying to save an dynamically generated image file in the local memory using the Image
    class.In brief I'm getting exactly 3 types of exceptions:-
    1)java.io.FileNotFoundException: pic5.jpg (Access is denied)
    2)"Exception in thread "main" java.lang.NullPointerException
    3)Exception in thread "main" com.sun.image.codec.jpeg.ImageFormatException: Not a JPEG file: starts with 0xff 0xd9
    Here is the code snippent I wrote:
    /* Robot robot = new Robot();
    BufferedImage image = robot.createScreenCapture(screenRect);
    // save captured image to jpg file
    ImageIO.write(image, "jpg", new File(outFileName));*/
    And here is the exception I am finding (I never found this before, I executed the code many times )
    =====================================================================================================================
    1)Exception Type 1:-
    java.io.FileNotFoundException: pic5.jpg (Access is denied)
    at java.io.RandomAccessFile.open(Native Method)
    at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
    at javax.imageio.stream.FileImageOutputStream.<init>(FileImageOutputStream.java:44)
    at com.sun.imageio.spi.FileImageOutputStreamSpi.createOutputStreamInstance(FileImageOutputStreamSpi.java:37)
    at javax.imageio.ImageIO.createImageOutputStream(ImageIO.java:391)
    at javax.imageio.ImageIO.write(ImageIO.java:1483)
    at Test_ScreenShot.main(Test_ScreenShot.java:112)
    at Test_Main.main(Test_Main.java:466)
    at Test_ScreenShot.main(Test_ScreenShot.java:129)
    2)Exception Type 2:-
    "Exception in thread "main" java.lang.NullPointerException
    at Picture.width(Picture.java:84)
    at Test_Edge_Detector.not_main(Test_Edge_Detector.java:38)
    at Test_Main.main(Test_Main.java:88)"
    ============================================================================================
    Now I tried the following as alternative of ImageIO(from jdk 1.2)
    to read image:-
    FileInputStream fis = new FileInputStream(file);
    JPEGImageDecoder jpeg = JPEGCodec.createJPEGDecoder(fis);
    jpeg.decodeAsBufferedImage();
    fis.close();
    But after running a long time suddenly its giving following exceptions:-
    ==============================================================================================
    Exception Type 3:- )
    Exception in thread "main" com.sun.image.codec.jpeg.ImageFormatException: Not a JPEG file: starts with 0xff 0xd9
    at sun.awt.image.codec.JPEGImageDecoderImpl.readJPEGStream(Native Method)
    at sun.awt.image.codec.JPEGImageDecoderImpl.decodeAsBufferedImage(Unknown Source)
    Exception Type 4:- )
    javax.imageio.IIOException: Not a JPEG file: starts with 0xff 0xd9
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImageHeader(Native Method)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.readNativeHeader(Unknown Source)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.checkTablesOnly(Unknown Source)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.gotoImage(Unknown Source)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.readHeader(Unknown Source)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(Unknown Source)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(Unknown Source)
    at javax.imageio.ImageIO.read(Unknown Source)
    at javax.imageio.ImageIO.read(Unknown Source)
    at Picture.<init>(Picture.java:22)
    at Test_Edge_Detector.not_main(Test_Edge_Detector.java:37)
    at Test_Main.main(Test_Main.java:88)
    Exception in thread "main" java.lang.RuntimeException: Could not open file: pic45.jpg
    at Picture.<init>(Picture.java:27)
    at Test_Edge_Detector.not_main(Test_Edge_Detector.java:37)
    at Test_Main.main(Test_Main.java:88)
    My question is:-
    1)Where is the actual problem?Is it any kind of bug?
    2)I'm using the concept of piping recently to execute the application.Can it be the cause?
         When I googled I found the following informations.There is a bug in ImageIO while trying to write image file.But
    I'm not sure about that it will be relevent here :-
    1)from sun's bug database:-
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6247985
    2)from SUN Developer Forums
    http://forum.java.sun.com/thread.jspa?threadID=768917&messageID=4382833
    3)from Java.NET forum(here they r getting the bug while they r using createScreenCapture() method of robot class,I am
    also using that in my code)
    http://forums.java.net/jive/thread.jspa?messageID=123247
    4)from SUN's archieve
    http://archives.java.sun.com/cgi-bin/wa?A2=ind0207&L=java-imageio-interest&D=0&P=1483
    5)Here is the actual implemetation of ImageIO class.I'm getting error at 391 no. line.
    http://kickjava.com/src/javax/imageio/ImageIO.java.htm
    Thanks And Regards
    Subhadip

    Hello,
    I am writng to ask a doubt I have been encountered. I have an array of Image URL's and I am downloading the images using thses URL for each index. The example for an image URL will be as follows:
    http://www.firstmonday.org/issues/issue6_10/wiggins/google-3oct2001.gifIf the URL is abroken link, I am getting the exception. But if the URL is somewhat hanging (which means when u open that URL in IE or Mozilla, the statuc bar for downloading the image will be hanging).
    So i want to set a timer for every link while downloading. may be 10min. My idea is if in that 10min, if code does not completes downloading the images, then ignore that link and proceed furthur.
    Can u please tell me how to write this.. Please tell me any other idea to tackle this problem.
    Thank you,
    Chaitanya

  • [Solved]Strange piping issue..

    Sometimes when I try piping commands, I simply get a "command not found" even though the commands are correct for sure.
    The commands will work when I remove the space after the pipe... It's really annoying and it has happened to me on different distributions, so it's not just Arch. I managed to get a fantastic example just now and this time I thought to myself "This time, I'll HAVE to figure this out!!!"
    So, see this example below. I even got an error message, which I think hasn't happened before.
    ~$ man bash | wc -l
    4892
    ~$ man mplayer | wc -l
    bash: wc: command not found
    Error executing formatting or display command.
    System command (cd "/usr/share/man" && (echo ".pl 11i"; /bin/cat '/usr/share/man/man1/mplayer.1') | /usr/bin/gtbl | /usr/bin/nroff -mandoc -c | /bin/less -is) exited with status 36096.
    No manual entry for mplayer
    ~$ man mplayer |wc -l
    8086
    So, what's this? It isn't a simple one-time issue, if I try to repeat the command it fails every time but when I remove the space it works. I don't know if the error message is related to this issue though, because this is the first time it has shown itself, even though I've stumbled across this issue many times.
    Last edited by initbox (2008-12-01 20:10:01)

    XDG_DATA_HOME=/home/nk/.local/share
    SHELL=/bin/bash
    TERM=screen
    HISTSIZE=1000
    QT_XFT=true
    HUSHLOGIN=FALSE
    WINDOWID=8388615
    QTDIR=/opt/qt
    LC_ALL=en_US.UTF-8
    USER=nk
    TERMCAP=SC|screen|VT 100/ANSI X3.64 virtual terminal:\
    :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:bs:bt=\E[Z:\
    :cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:ct=\E[3g:\
    :do=^J:nd=\E[C:pt:rc=\E8:rs=\Ec:sc=\E7:st=\EH:up=\EM:\
    :le=^H:bl=^G:cr=^M:it#8:ho=\E[H:nw=\EE:ta=^I:is=\E)0:\
    :li#85:co#279:am:xn:xv:LP:sr=\EM:al=\E[L:AL=\E[%dL:\
    :cs=\E[%i%d;%dr:dl=\E[M:DL=\E[%dM:dc=\E[P:DC=\E[%dP:\
    :im=\E[4h:ei=\E[4l:mi:IC=\E[%d@:ks=\E[?1h\E=:\
    :ke=\E[?1l\E>:vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l:\
    :ti=\E[?1049h:te=\E[?1049l:us=\E[4m:ue=\E[24m:so=\E[3m:\
    :se=\E[23m:mb=\E[5m:md=\E[1m:mr=\E[7m:me=\E[m:ms:\
    :Co#8:pa#64:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:AX:\
    :vb=\Eg:G0:as=\E(0:ae=\E(B:\
    :ac=\140\140aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhII00:\
    :po=\E[5i:pf=\E[4i:k0=\E[10~:k1=\EOP:k2=\EOQ:k3=\EOR:\
    :k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\
    :k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:F3=\E[25~:\
    :F4=\E[26~:F5=\E[28~:F6=\E[29~:F7=\E[31~:F8=\E[32~:\
    :F9=\E[33~:FA=\E[34~:kb=:K1=\EOw:K2=\EOu:K3=\EOy:\
    :K4=\EOq:K5=\EOs:kB=\E[Z:kE=\E[8\^:*4=\E[3$:*7=\E[8$:\
    :#2=\E[7$:#3=\E2$:#4=\E[d:%c=\E[6$:%e=\E[5$:%i=\E[c:\
    :kh=\E[1~:@1=\E[1~:kH=\E[4~:@7=\E[4~:kN=\E[6~:kP=\E[5~:\
    :kI=\E[2~:kD=\E[3~:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:km:
    OOO_FORCE_DESKTOP=gnome
    MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins:/opt/mozilla/lib/plugins
    XDG_CONFIG_DIRS=/etc/xdg:/opt/kde/etc/xdg
    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/opt/kde/bin:/usr/bin/perlbin/site:/usr/bin/perlbin/vendor:/usr/bin/perlbin/core:/opt/qt/bin
    MAIL=/var/spool/mail/nk
    STY=2868.pts-0.hostname
    LC_COLLATE=C
    PWD=/home/nk
    INPUTRC=/etc/inputrc
    EDITOR=vim
    LANG=en_US.utf8
    KDEDIRS=/usr:/opt/kde
    PS3=>
    HISTCONTROL=ignoredups
    HOME=/home/nk
    PS4=+
    SHLVL=5
    COLORFGBG=15;0
    XDG_CONFIG_HOME=/home/nk/.config
    TERMINFO=/usr/share/terminfo
    XDG_CACHE_HOME=/home/nk/.cache
    LOGNAME=nk
    LESS=-R
    WINDOW=5
    XDG_DATA_DIRS=/usr/share:/usr/local/share:/opt/kde/share
    PKG_CONFIG_PATH=:/opt/kde/lib/pkgconfig:/opt/qt/lib/pkgconfig
    WINDOWPATH=7
    DISPLAY=:0
    G_BROKEN_FILENAMES=1
    XAUTHORITY=/home/nk/.Xauthority
    COLORTERM=rxvt
    _=/usr/bin/printenv
    Here you go. But I don't think it's really environment specific, since I've had this occur in Ubuntu with full Gnome and now I'm using urxvt with screen. I think I've actually seen this happen in actual shells. I've always had bash though. Oh well..
    Last edited by initbox (2008-12-01 19:20:19)

  • Piping multiple arguments

    Hello,
    With an automated shell script I wish to create an encrypted disk image that requires sudo access and encryption password.
    So I tried with the following command lines but it stills ask me to enter an administrator password.
    Thanks in advance for helping
    #!/bin/bash
    MY_PASS="xyz"
    echo $MY_PASS | sudo -S printf $MY_PASS | hdiutil create -encryption -stdinpass -srcfolder "/myfolder" -volname "name" "/destination/name.dmg"

    Why are you piping the output from the sudo command to hdiutil? Maybe you need to do something like this:
    #!/bin/bash
    MY_PASS="xyz"
    echo $MY_PASS | sudo -S hdiutil create -encryption -stdinpass
    -srcfolder "/myfolder" -volname "name" "/destination/name.dmg"
    OR
    #!/bin/bash
    MY_PASS="xyz"
    echo $MY_PASS | sudo -vS # Updates the sudo timestamp
    sudo hdiutil create -encryption -stdinpass -srcfolder "/myfolder"
    -volname "name" "/destination/name.dmg"

  • RegEx to fix:XML output parsing on separate lines after using piped queries

    I have ran two xpath queries to retrieve information about a template. the piped query was to retrieve the and the . When I ran it it retrieved the information as below. It has done this for over 20 lines and in this exact sequence. But what I want is to move the attribute so it is next to attribute because that information is related to the same item. Is there any scriptlet that can help me with this? Anyone?XMLrd://test1.db.com/81e7d3bc-e9ac-4932-aa60-f495a800f123TEMPLATE_Srd://test2.db.com/8a8589bf-49e3-4cd7-af15-6753067355c6TEMPLATE_RXMLrd://test2.db.com/8a8589bf-49e3-4cd7-af15-6753067355c6TEMPLATE_Rrd://test2.db.com/8a8589bf-49e3-4cd7-af15-6753067355c6TEMPLATE_RSo the ideal outcome would be something like
    This topic first appeared in the Spiceworks Community

    table.altrowstable { font-family: verdana,arial,sans-serif; font-size:11px; color:#333333; border-width: 1px; border-color: #a9c6c9; border-collapse: collapse;}table.altrowstable th { border-width: 1px; padding: 8px; border-style: solid; border-color: #a9c6c9;}table.altrowstable td { border-width: 1px; padding: 8px; border-style: solid; border-color: #a9c6c9;}.oddrowcolor{ background-color:#d4e3e5;}.evenrowcolor{ background-color:#c3dde0;} .left{float:left; width:50%;}Standard Configuration OptionsCPU: Intel Core i 2310M Dual Core 2.10GHzRAM: 4GB - DDR3 Unbuffered DIMMs 8GB - DDR8 Unbuffered DIMMs Hard Disc Drive: 250GB SATA120GB SATA SSDScreenSize:
    14 inch LCD screenResolution:
    1366 x 768Additional FeaturesOptical Drive: DVD R/RWGraphics:Intel HD Graphics 3000Network: Integrated Gigabit Gigabit Network ConnectionWiFi (802.11 a/b/g/n...

  • Piping in unix

    I'm sure everyone has seen how you can do the following in unix.
    "ls | more"
    "ls | grep foo | more
    I'm writing a java program that I want to work where the grep foo is. I know how to do the output, but I'm not sure how to take in what would be.... piped input I guess. I've tried harnessing System.in as an input stream to no avail.

    You mentioned that you tried harnessing System.in to no avail. I'm curious as to how you tried this as it is the correct way to read from a pipe or redirect.
    The following example shows how you can do this.
    public class Test {
      public static void main(String[] args) throws Exception {
        StringBuffer buffer = new StringBuffer();
        int character = -1;
        while ((character = System.in.read()) != -1) {
          buffer.append((char) character);
        System.out.println("Read: " + buffer.length() + " bytes.");
    }Cheers,
    Zulq.

Maybe you are looking for