JS to execute grep

how to write JS to execute the grep in InDesign? e.g grep1 then grep2 then grep3?
Thanks in advance.

Here is an approach that I use in my Protect local styling script:
Create an array of arrays -- each element of the array is a two elements array: [ find what, change to ].
myGrpReplace =     [
            ["[~m~>~f~|~S~s~<~/~.~3~4~% ]{2,}", " "], // Multiple Space to Single Space
            ["--", "~_"], // Dash Dash to Em-dash
            ["~b~b+", "\\r"] // Multiple Return to Single Return
Then process the array in a function:
function replaceGrep() {
     app.findGrepPreferences = NothingEnum.nothing;
     app.changeGrepPreferences = NothingEnum.nothing;
     for (i = 0; i <  myGrpReplace.length; i++) {
          var myCurArray = myGrpReplace[i];
          app.findGrepPreferences.findWhat = myCurArray[0];
          app.changeGrepPreferences.changeTo = myCurArray[1];
          myTextFrame.parentStory.changeGrep();
     app.findGrepPreferences = NothingEnum.nothing;
     app.changeGrepPreferences = NothingEnum.nothing;
replaceGrep(); // call function

Similar Messages

  • -bash: /usr/bin/grep: Bad executable (or shared library)

    I am receiving these error messages when I attempt to use grep, egrep, or fgrep from the terminal:
    -bash: /usr/bin/grep: Bad executable (or shared library)
    -bash: /usr/bin/egrep: Bad executable (or shared library)
    -bash: /usr/bin/fgrep: Bad executable (or shared library)
    I suspect that a library that these utilities use is corrupt, but I am not sure how to determine what libraries the executables use and how to restore them if they are indeed corrupt. Can someone fill me in?
    Thanks,
    Greg
    Dual 2 GHz PowerPC G5   Mac OS X (10.4.7)  

    Hi Greg,
       Sorry, otool is installed by Apple's Developer Tools package. The other listings you posted are also identical to mine so I'm stumped. I also have a G5 so the fact that your items are the same size as mine is at least strong evidence that they aren't corrupted.
       You can use the application Pacifist, to pull a new copy of grep from your Mac OS X install disk. It couldn't hurt to be sure.
       libSystem.B.dylib is in turn dependent on /usr/lib/system/libmathCommon.A.dylib so there's one more possibility for a problem but there the dependency chain stops. Besides, if either of those libraries were corrupted, I would think you would have noticed something before.
       You should check to see if the following environment variable is defined: (it should not be defined)
    echo $DYLDLIBRARYPATH
    You should also login as another user (even if you have to create one temporarily) and execute grep. If that user can do it then the problem lies in the environment of your current user.
    Gary
    ~~~~
       Old Mother Hubbard went to the cupboard
       To fetch her poor daughter a dress.
       When she got there, the cupboard was bare
       And so was her daughter, I guess...

  • [Solved] Trying to grep a hex pattern from a binary dump - not working

    Hi all, I'm not sure if this is the right forum but as it is related to a scripting course I'm doing I couldn't see anywhere more suitable.
    I have a raw disk dump that contains several jpeg images etc...  I'm trying to make a carving utility to extract the images using bash and ultimately grep to do the heavy lifting.
    What I'm trying to do is to grep hex escaped character values within the raw disk dump to find the location where a jpeg image starts.  The jpeg image file header in hex is "ffd8ff".  The most straight forward example I could find for how to achieve this was from here: http://www.commandlinefu.com/commands/v … l-patterns
    According to that page I should be able to execute grep -P "\xff\xd8\xff" diskdump.raw in order to be able to get some sort of match, however in spite of my certainty that there are a number of jpeg images in the disk dump (I created the disk dump) and the fact that I can use hex dump utilities to confirm the presence of the matching header grep is refusing to play ball and acknowledge a match. I don't know what to do, other people on the course are able to use grep this way with different distributions.
    Does anyone know if this is a known issue, has anyone come across it before and, better yet, does anyone know how I can get grep to bend to my will on Arch?
    Thanks in advance,
    B
    Last edited by Baz_ (2015-04-03 08:55:11)

    Trilby wrote:
    I think you'll need the -a flag for grep (unless you use ewaller's od approach):
    man grep wrote:-a, --text
            Process a binary file as if it were text; this is equivalent to the --binary-files=text option.
    I have tried "grep -a ...", "grep -Pa ..." and the version that works for my class mate "grep -obPa ..." plus several other variations of the above and none of them work.
    I have a working version of a carver similar to ewaller's idea using a hexdump utility (xxd) rather than od but because of the fact that the header and footer could roll over from one line to another it is extremely inefficient as it requires two searches through the file to ensure that you have found the earliest header (the second search pads a few characters to the front of the raw dump depending on the size of the header).
    The ability to search for a string of characters by their hex values with grep would lead to much more efficient code.
    I don't suppose grep is due an update soon that might cause it to do what I want? Or even better is someone knows how to get grep as it stands to do what I want?
    Thanks for your posts so far guys, much appreciated.
    B

  • Wizardpen and Xorg 1.8.1, Genius Tablet problem and solution

    Hello!!! I post this information just to contribute with a solution to a problem I was fighting with in the last days. I search for an answer and did not find it. If someone need more information feel free to ask. Oh! And sorry for my english.
    The Problem:
    After the update of Xorg and the Wizardpen driver from the AUR my tablet was not working anymore. The hal policy did not work, because Xorg now uses other method for hotplugged devices. If you want to learn more read this http://wiki.archlinux.org/index.php/Xorg#InputClasses
    Solution:
    We have to tell Xorg wich is the driver for that device creating an InputClass. To do that, we need some info about the tablet first. Execute:
    grep -i name /proc/bus/input/devices
    and search for a line with the name of your tablet. In my case is:
    Name="UC-LOGIC Tablet WP8060U"
    Now we need to calibrate the tablet, first execute:
    cat /proc/bus/input/devices
    And search for a devices with the name you see before. In my case:
    I: Bus=0003 Vendor=5543 Product=0005 Version=0100
    N: Name="UC-LOGIC Tablet WP8060U"
    P: Phys=usb-0000:00:02.0-3/input0
    S: Sysfs=/devices/pci0000:00/0000:00:02.0/usb2/2-3/2-3:1.0/input/input5
    U: Uniq=
    H: Handlers=mouse0 event5
    B: EV=1f
    B: KEY=c01 0 3f0001 0 0 0 0 0 0 0 0
    B: REL=303
    B: ABS=100000f
    B: MSC=10
    See the line "H: Handlers=mouse0 event5". The last part tells you the device is in event5 (note that we do not use the mouse0), in your case could be other. Use this info to execute the next command with your event number:
    wizard-calibrate /dev/input/event5
    Follow the on screen instruccions (press the pen on a corner of the tablet and on the oposite corner).  The last lines of the output look like this:
    Driver "wizardpen"
    Option "TopX" "2691"
    Option "TopY" "3249"
    Option "BottomX" "31462"
    Option "BottomY" "30089"
    Option "MaxX" "31462"
    Option "MaxY" "30089"
    We will use this info in a moment.
    Later create a text file /etc/X11/xorg.conf.d/70-wizardpen.conf and put this content in it, but remember to change the text "THE NAME OF YOUR TABLET" to match the name you find previously and the configuration of your tablet calibration:
    Section "InputClass"
    Identifier "wizardpen"
    MatchProduct "THE NAME OF YOUR TABLET"
    MatchDevicePath "/dev/input/event*"
    Driver "wizardpen"
    Option "TopX" "2691"
    Option "TopY" "3249"
    Option "BottomX" "31462"
    Option "BottomY" "30089"
    Option "MaxX" "31462"
    Option "MaxY" "30089"
    EndSection
    Section "InputClass"
    Identifier "wizardpen ignore mouse dev"
    MatchProduct "THE NAME OF YOUR TABLET"
    MatchDevicePath "/dev/input/mouse*"
    Driver ""
    EndSection
    In my case the file is
    Section "InputClass"
    Identifier "wizardpen"
    MatchProduct "UC-LOGIC Tablet WP8060U"
    MatchDevicePath "/dev/input/event*"
    Driver "wizardpen"
    Option "TopX" "2691"
    Option "TopY" "3249"
    Option "BottomX" "31462"
    Option "BottomY" "30089"
    Option "MaxX" "31462"
    Option "MaxY" "30089"
    EndSection
    Section "InputClass"
    Identifier "wizardpen ignore mouse dev"
    MatchProduct "UC-LOGIC Tablet WP8060U"
    MatchDevicePath "/dev/input/mouse*"
    Driver ""
    EndSection
    Restart X or restart your computer and that's all. MY TABLET WORKS!!!
    I read somewhere else, I don't remember where, that you can set other match sentences for Xorg that do not work for me, for some reason this is false for my tablet so I did not use this but for you may work. Inside the "Section" -> "EndSection" you can try to put this "Match" sentences in case Xorg failed to recognize your device.
    MatchIsTablet "on"
    MatchVendor "UC-LOGIC|KYE Systems|Ace Cad"
    MatchDevicePath "/dev/input/by-id/usb-UC-LOGIC_Tablet_WP8060U-event-mouse"
    The last one is obtained whit this command:
    ls /dev/input/by-id
    search for two devices, one called usb-name_of_your_tablet-event-mouse and other called usb-name_of_your_tablet-mouse, in my case the output of the "ls /dev/input/by-id" command is:
    usb-UC-LOGIC_Tablet_WP8060U-event-mouse
    usb-UC-LOGIC_Tablet_WP8060U-mouse
    If you want to try you have to put those devices names in the right place, note that this not work for me. The file /etc/X11/xorg.conf.d/70-wizardpen.conf would be like this, remember to change the device path to match yours:
    Section "InputClass"
    Identifier "wizardpen"
    MatchIsTablet "on"
    MatchDevicePath "/dev/input/by-id/usb-UC-LOGIC_Tablet_WP8060U-event-mouse"
    MatchVendor "UC-LOGIC|KYE Systems|Ace Cad"
    Driver "wizardpen"
    Option "TopX" "2691"
    Option "TopY" "3249"
    Option "BottomX" "31462"
    Option "BottomY" "30089"
    Option "MaxX" "31462"
    Option "MaxY" "30089"
    EndSection
    Section "InputClass"
    Identifier "wizardpen ignore mouse dev"
    MatchIsTablet "on"
    MatchDevicePath "/dev/input/by-id/usb-UC-LOGIC_Tablet_WP8060U-mouse"
    MatchVendor "UC-LOGIC|KYE Systems|Ace Cad"
    Driver ""
    EndSection
    Ok, I hope someone find this usefull, good luck!
    Last edited by gooze (2010-06-25 18:55:18)

    I updated the driver to the last version in AUR. It works without any configuration at me (no calibration or custom xorg.conf entries). I tried with xorg-server 1.9+ only, though.

  • Macbook Pro - no wireless interface

    I have a unibody macbook pro, trying to get the wireless to work but the wiki seems to have brought me to a dead end.
    According to this:
    $ lspci -vnn | grep 14e4
    02:00.0 Ethernet controller [0200]: Broadcom Corporation NetXtreme BCM5764M Gigabit Ethernet PCIe [14e4:1684] (rev 10)
    Subsystem: Broadcom Corporation NetXtreme BCM5764M Gigabit Ethernet PCIe [14e4:1684]
    03:00.0 Network controller [0280]: Broadcom Corporation BCM43224 802.11a/b/g/n [14e4:4353] (rev 01)
    I have a BCM43224, which uses the brcmsmac driver. According to the wiki, this driver is included in the kernel and requires no setup at all.
    But the wireless interface doesn't come up when I do this:
    $ ip link
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 58:b0:35:fd:07:94 brd ff:ff:ff:ff:ff:ff
    I'm not sure what more I should post, but here's the output from hwdetect:
    $ hwdetect --show-net
    NET : libphy tg3 bluetooth mac80211 rfkill cfg80211
    I don't know what any of those mean, other than bluetooth
    Surely I must be missing something simple if this driver is supposed to "just work", right?

    ankillito wrote:
    And here's the relevant wiki troubleshooting guide that suggests the blacklisting mentioned in the previous post. I mention this because the wiki also says:
    Now, rebuild the initramfs image and everything should work as expected.
    # mkinitcpio -p linux
    So, I did this and it doesn't seem to have worked. The link that karol pointed to says this:
    To see if you were successful, execute
    grep bcma /proc/modules
    If there is no output, then blacklisting was successful.
    But there was output:
    $ grep bcma /proc/modules
    bcma 11198 0 - Live 0xfb5f5000
    So apparently the blacklisting was unsuccessful.

  • Version of AFSTATSB.pls

    Hi,
    EBS 115102
    DB 10203
    Please advice how to find the version of AFSTATSB.pls .
    Thanks

    It will be in the first few lines of the file.
    Or execute "grep Head AFSTATSB.pls" command in Unix.
    How To Know PLS Version On Database ? (Doc ID 188246.1)
    How To Get Version of Programs, Files, and Objects Necessary for Oracle Applications? (Doc ID 121916.1)
    HTH
    Srini

  • How to execute " cat foo | grep something " in java

    Hi guys ...
    Am trying to execute " cat foo | grep dude " , where foo is a text file which contains a lot of texts and words. I tried a lot of choices but I end up with nothing like -
    Process p = Runtime.getRuntime().exec(new String[] {"cat", "foo"}); , and by creating a stream reader on the process I get the content of foo file , but I want to grep something and I tried , Process p = Runtime.getRuntime().exec(new String[] {"cat", "anas","| grep Dude"}); but I got the same result from the above command , I tried a lot of possibilities like -
    (new String[] {"cat", "anas","|", "grep", "Dude"});
    (new String[] {"cat anas | ","grep Dude"});
    and so on , also I tried to put the command in a string and execute it like here
    String command = "cat" + " foo" + " |" + " grep Dude" ;
    Process p = Runtime.getRuntime().exec(command);
    .. I don't know it's like work fine but when it reached the part that related to " grep something" it just ignore it . so can someone help me in this .thanks for reading and thanks in advance for any further help ... by the way this the content of the foo file
    Dude I Am here
    what !! you cant
    see me or you
    pretend to be blind !!

    if cat and grep are executable programs that work outside of the console app, it should work. But I don't think this is the case, in which case you need to open a console first.
    I haven't tried this on Unix, but below is how to do it on Windows. If you wanted to run "more" or "less" or "cd" etc in on dos, you need to open the console first.
              String cmd = "cmd.exe";
              TextAreaOutputStream taos = new TextAreaOutputStream(this);
              try {
                   mDOS = Runtime.getRuntime().exec(cmd);
                   Piper p = new Piper (mDOS.getInputStream(), taos);
                   new Thread(p).start();
                   p = new Piper (mDOS.getErrorStream(), taos);
                   new Thread(p).start();
                   mDosOut = new PrintStream(mDOS.getOutputStream());
              catch (IOException iox) {
                   iox.printStackTrace();
              }

  • Error while executing the script adgetlnxver.sh

    Error while executing the script adgetlnxver.sh on apps&db tier during upgrade from 11.5.9 to 11.5.10.2
    -bash: [: -lt: unary operator expected
    [aptinst@dba5 TINST_dba5]$ sh adapcctl.sh restart
    adapcctl.sh version 115.55
    /u01/app/tinst/tinstappl/ad/11.5.0/bin/adgetlnxver.sh: line 123: [: -lt: unary operator expected
    Apache Web Server Listener :httpd ( pid 8645 ) is running.
    Restarting the Apache Web Server Dedicated HTTP Listener..
    Apache Web Server Listener (PLSQL) :httpd ( pid 8673 ) is running.
    Restarting the Apache Web Server Dedicated PLSQL Listener..
    adapcctl.sh: exiting with status 0
    In adgetlnxver.sh: line 123 says
    if [ ${setflag}x = "x" -a $os = "RH" ]; then
    redhatver=`grep -oP "Enterprise Linux [a-z A-Z 0-9]* release [0-9]+" /etc/redhat-release | sed 's/Enterprise Linux [a-z A-Z 0-9]* release //g'`
    if [ $redhatver -lt 5 ]; then
    LD_ASSUME_KERNEL="2.4.19"
    export LD_ASSUME_KERNEL
    fi
    fi
    Thanks,
    Vamsi

    Hi Vamsi.
    The exactly erro refers to a problems when you try upgrade from these version to 11.5.10.
    Can you read this note and apply solution? The note refers a patch, but the problem is the same.
    After Patch 4334965, adstrtal.sh & adstpall.sh is failing with errors [ID 360046.1]
    BR Rafael Ceolim

  • [SOLVED] C Compiler Cannot Create Executables

    I am aware that there is already a thread on this here however it failed to solve my issue. I have installed the multilib-devel packages as the referenced post suggested, but I still receive the following error message when attempting to compile wine-mono package either with makepkg or with yaourt.
    checking build system type... x86_64-unknown-linux-gnu
    checking host system type... x86_64-w64-mingw32
    checking target system type... x86_64-w64-mingw32
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for x86_64-w64-mingw32-strip... no
    checking for strip... strip
    configure: WARNING: using cross tools not prefixed with host triplet
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking how to create a ustar tar archive... gnutar
    checking whether to enable maintainer-specific portions of Makefiles... no
    checking whether ln -s works... yes
    checking host platform characteristics... ok
    checking for x86_64-w64-mingw32-gcc... no
    checking for gcc... gcc
    checking for x86_64-w64-mingw32-gcc... gcc
    checking whether the C compiler works... no
    configure: error: in `/tmp/yaourt-tmp-sensei/aur-wine-mono/src/wine-mono-0.0.4/build-cross-x86_64':
    configure: error: C compiler cannot create executables
    See `config.log' for more details
    My config.log:
    This file contains any messages produced by compilers while
    running configure, to aid debugging if configure makes a mistake.
    It was created by mono configure 2.11.1, which was
    generated by GNU Autoconf 2.69. Invocation command line was
    $ ../mono/configure --prefix=/home/sensei/Downloads/Builds/wine-mono/src/wine-mono-0.0.4/build-cross-x86_64-install --build=x86_64-unknown-linux-gnu --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --with-tls=none --disable-mcs-build --enable-win32-dllmain=yes --with-libgc-threads=win32 PKG_CONFIG=false mono_cv_clang=no
    ## Platform. ##
    hostname = archmage
    uname -m = x86_64
    uname -r = 3.3.8-1-ARCH
    uname -s = Linux
    uname -v = #1 SMP PREEMPT Tue Jun 5 15:20:32 CEST 2012
    /usr/bin/uname -p = unknown
    /bin/uname -X = unknown
    /bin/arch = unknown
    /usr/bin/arch -k = unknown
    /usr/convex/getsysinfo = unknown
    /usr/bin/hostinfo = unknown
    /bin/machine = unknown
    /usr/bin/oslevel = unknown
    /bin/universe = unknown
    PATH: /usr/local/bin
    PATH: /usr/bin
    PATH: /bin
    PATH: /usr/local/sbin
    PATH: /usr/sbin
    PATH: /sbin
    PATH: /usr/bin/core_perl
    PATH: /home/sensei/Documents/Scripts
    ## Core tests. ##
    configure:2970: checking build system type
    configure:2984: result: x86_64-unknown-linux-gnu
    configure:3004: checking host system type
    configure:3017: result: x86_64-w64-mingw32
    configure:3037: checking target system type
    configure:3050: result: x86_64-w64-mingw32
    configure:3099: checking for a BSD-compatible install
    configure:3167: result: /usr/bin/install -c
    configure:3178: checking whether build environment is sane
    configure:3233: result: yes
    configure:3292: checking for x86_64-w64-mingw32-strip
    configure:3322: result: no
    configure:3332: checking for strip
    configure:3348: found /usr/bin/strip
    configure:3359: result: strip
    configure:3371: WARNING: using cross tools not prefixed with host triplet
    configure:3384: checking for a thread-safe mkdir -p
    configure:3423: result: /bin/mkdir -p
    configure:3430: checking for gawk
    configure:3446: found /usr/bin/gawk
    configure:3457: result: gawk
    configure:3468: checking whether make sets $(MAKE)
    configure:3490: result: yes
    configure:3565: checking how to create a ustar tar archive
    configure:3578: tar --version
    tar (GNU tar) 1.26
    Copyright (C) 2011 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    Written by John Gilmore and Jay Fenlason.
    configure:3581: $? = 0
    configure:3621: tardir=conftest.dir && eval tar --format=ustar -chf - "$tardir" >conftest.tar
    configure:3624: $? = 0
    configure:3628: tar -xf - <conftest.tar
    configure:3631: $? = 0
    configure:3644: result: gnutar
    configure:3654: checking whether to enable maintainer-specific portions of Makefiles
    configure:3663: result: no
    configure:3680: checking whether ln -s works
    configure:3684: result: yes
    configure:3737: checking host platform characteristics
    configure:4029: result: ok
    configure:4090: checking for x86_64-w64-mingw32-gcc
    configure:4120: result: no
    configure:4130: checking for gcc
    configure:4146: found /usr/bin/gcc
    configure:4157: result: gcc
    configure:4187: checking for x86_64-w64-mingw32-gcc
    configure:4214: result: gcc
    configure:4483: checking for C compiler version
    configure:4492: gcc --version >&5
    gcc (GCC) 4.7.0 20120505 (prerelease)
    Copyright (C) 2012 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    configure:4503: $? = 0
    configure:4492: gcc -v >&5
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
    Target: x86_64-unknown-linux-gnu
    Configured with: /build/src/gcc-4.7-20120505/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --enable-libstdcxx-time --enable-gnu-unique-object --enable-linker-build-id --with-ppl --enable-cloog-backend=isl --enable-lto --enable-gold --enable-ld=default --enable-plugin --with-plugin-ld=ld.gold --with-linker-hash-style=gnu --disable-multilib --disable-libssp --disable-build-with-cxx --disable-build-poststage1-with-cxx --enable-checking=release
    Thread model: posix
    gcc version 4.7.0 20120505 (prerelease) (GCC)
    configure:4503: $? = 0
    configure:4492: gcc -V >&5
    gcc: error: unrecognized command line option '-V'
    gcc: fatal error: no input files
    compilation terminated.
    configure:4503: $? = 1
    configure:4492: gcc -qversion >&5
    gcc: error: unrecognized command line option '-qversion'
    gcc: fatal error: no input files
    compilation terminated.
    configure:4503: $? = 1
    configure:4523: checking whether the C compiler works
    configure:4545: gcc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024 -DGC_NOT_DLL -Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu -lmswsock -lws2_32 -lole32 -loleaut32 -lpsapi -lversion -ladvapi32 -lwinmm -lkernel32 conftest.c >&5
    /usr/bin/ld: cannot find -lmswsock
    /usr/bin/ld: cannot find -lws2_32
    /usr/bin/ld: cannot find -lole32
    /usr/bin/ld: cannot find -loleaut32
    /usr/bin/ld: cannot find -lpsapi
    /usr/bin/ld: cannot find -lversion
    /usr/bin/ld: cannot find -ladvapi32
    /usr/bin/ld: cannot find -lwinmm
    /usr/bin/ld: cannot find -lkernel32
    collect2: error: ld returned 1 exit status
    configure:4549: $? = 1
    configure:4587: result: no
    configure: failed program was:
    | /* confdefs.h */
    | #define PACKAGE_NAME "mono"
    | #define PACKAGE_TARNAME "mono"
    | #define PACKAGE_VERSION "2.11.1"
    | #define PACKAGE_STRING "mono 2.11.1"
    | #define PACKAGE_BUGREPORT "http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono"
    | #define PACKAGE_URL ""
    | #define PACKAGE "mono"
    | #define VERSION "2.11.1"
    | #define HOST_WIN32 1
    | #define DISABLE_PORTABILITY 1
    | #define PLATFORM_NO_SYMLINKS 1
    | #define TARGET_WIN32 1
    | #define MINGW_CROSS_COMPILE 1
    | /* end confdefs.h. */
    |
    | int
    | main ()
    | {
    |
    | ;
    | return 0;
    | }
    configure:4592: error: in `/home/sensei/Downloads/Builds/wine-mono/src/wine-mono-0.0.4/build-cross-x86_64':
    configure:4594: error: C compiler cannot create executables
    See `config.log' for more details
    ## Cache variables. ##
    ac_cv_build=x86_64-unknown-linux-gnu
    ac_cv_env_CCASFLAGS_set=
    ac_cv_env_CCASFLAGS_value=
    ac_cv_env_CCAS_set=
    ac_cv_env_CCAS_value=
    ac_cv_env_CCC_set=
    ac_cv_env_CCC_value=
    ac_cv_env_CC_set=
    ac_cv_env_CC_value=
    ac_cv_env_CFLAGS_set=set
    ac_cv_env_CFLAGS_value='-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2'
    ac_cv_env_CPPFLAGS_set=
    ac_cv_env_CPPFLAGS_value=
    ac_cv_env_CPP_set=
    ac_cv_env_CPP_value=
    ac_cv_env_CXXCPP_set=
    ac_cv_env_CXXCPP_value=
    ac_cv_env_CXXFLAGS_set=set
    ac_cv_env_CXXFLAGS_value='-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2'
    ac_cv_env_CXX_set=
    ac_cv_env_CXX_value=
    ac_cv_env_LDFLAGS_set=set
    ac_cv_env_LDFLAGS_value=-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu
    ac_cv_env_LIBS_set=
    ac_cv_env_LIBS_value=
    ac_cv_env_XMKMF_set=
    ac_cv_env_XMKMF_value=
    ac_cv_env_build_alias_set=set
    ac_cv_env_build_alias_value=x86_64-unknown-linux-gnu
    ac_cv_env_host_alias_set=set
    ac_cv_env_host_alias_value=x86_64-w64-mingw32
    ac_cv_env_target_alias_set=set
    ac_cv_env_target_alias_value=x86_64-w64-mingw32
    ac_cv_host=x86_64-w64-mingw32
    ac_cv_path_install='/usr/bin/install -c'
    ac_cv_path_mkdir=/bin/mkdir
    ac_cv_prog_AWK=gawk
    ac_cv_prog_CC=gcc
    ac_cv_prog_ac_ct_CC=gcc
    ac_cv_prog_ac_ct_STRIP=strip
    ac_cv_prog_make_make_set=yes
    ac_cv_target=x86_64-w64-mingw32
    am_cv_prog_tar_ustar=gnutar
    mono_cv_clang=no
    ## Output variables. ##
    ACLOCAL='${SHELL} /home/sensei/Downloads/Builds/wine-mono/src/wine-mono-0.0.4/mono/missing --run aclocal-1.12'
    ALPHA_FALSE=''
    ALPHA_TRUE=''
    AMD64_FALSE=''
    AMD64_TRUE=''
    AMDEPBACKSLASH=''
    AMDEP_FALSE=''
    AMDEP_TRUE=''
    AMTAR='$${TAR-tar}'
    API_VER='2.0'
    AR=''
    ARM_FALSE=''
    ARM_TRUE=''
    AS=''
    AUTOCONF='${SHELL} /home/sensei/Downloads/Builds/wine-mono/src/wine-mono-0.0.4/mono/missing --run autoconf'
    AUTOHEADER='${SHELL} /home/sensei/Downloads/Builds/wine-mono/src/wine-mono-0.0.4/mono/missing --run autoheader'
    AUTOMAKE='${SHELL} /home/sensei/Downloads/Builds/wine-mono/src/wine-mono-0.0.4/mono/missing --run automake-1.12'
    AWK='gawk'
    BOEHM_DEFINES=''
    BUILD_EXEEXT=''
    BUILD_GLIB_CFLAGS=''
    BUILD_GLIB_LIBS=''
    BUILD_MCS_FALSE=''
    BUILD_MCS_TRUE=''
    CC='gcc'
    CCAS=''
    CCASDEPMODE=''
    CCASFLAGS=''
    CCDEPMODE=''
    CC_FOR_BUILD=''
    CFLAGS='-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2'
    CFLAGS_FOR_BUILD=''
    CPP=''
    CPPFLAGS=' -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024 -DGC_NOT_DLL'
    CROSS_COMPILING_FALSE=''
    CROSS_COMPILING_TRUE=''
    CXX=''
    CXXCPP=''
    CXXDEPMODE=''
    CXXFLAGS='-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2'
    CYGPATH_W='echo'
    DEFS=''
    DEPDIR=''
    DISABLE_EXECUTABLES_FALSE=''
    DISABLE_EXECUTABLES_TRUE=''
    DISABLE_JIT_FALSE=''
    DISABLE_JIT_TRUE=''
    DISABLE_PROFILER_FALSE=''
    DISABLE_PROFILER_TRUE=''
    DISABLE_SHARED_HANDLES=''
    DLLTOOL=''
    DOLT_BASH=''
    DSYMUTIL=''
    DTRACE=''
    DTRACEFLAGS=''
    DTRACE_G_REQUIRED_FALSE=''
    DTRACE_G_REQUIRED_TRUE=''
    DUMPBIN=''
    ECHO_C=''
    ECHO_N='-n'
    ECHO_T=''
    EGREP=''
    ENABLE_DTRACE_FALSE=''
    ENABLE_DTRACE_TRUE=''
    ENABLE_LLVM_FALSE=''
    ENABLE_LLVM_TRUE=''
    ENABLE_NUNIT_TESTS_FALSE=''
    ENABLE_NUNIT_TESTS_TRUE=''
    EXEEXT=''
    FGREP=''
    GETTEXT_MACRO_VERSION=''
    GLIB_CFLAGS=''
    GLIB_LIBS=''
    GMODULE_CFLAGS=''
    GMODULE_LIBS=''
    GMSGFMT=''
    GMSGFMT_015=''
    GREP=''
    HAVE_MSGFMT=''
    HAVE_OPROFILE_FALSE=''
    HAVE_OPROFILE_TRUE=''
    HAVE_ZLIB_FALSE=''
    HAVE_ZLIB_TRUE=''
    HOST_CC='gcc'
    HOST_WIN32_FALSE='#'
    HOST_WIN32_TRUE=''
    HPPA_FALSE=''
    HPPA_TRUE=''
    IA64_FALSE=''
    IA64_TRUE=''
    INCLUDED_LIBGC_FALSE=''
    INCLUDED_LIBGC_TRUE=''
    INSTALL_4_0_FALSE=''
    INSTALL_4_0_TRUE=''
    INSTALL_DATA='${INSTALL} -m 644'
    INSTALL_MOBILE_FALSE=''
    INSTALL_MOBILE_TRUE=''
    INSTALL_MONODROID_FALSE=''
    INSTALL_MONODROID_TRUE=''
    INSTALL_MONOTOUCH_FALSE=''
    INSTALL_MONOTOUCH_TRUE=''
    INSTALL_PROGRAM='${INSTALL}'
    INSTALL_SCRIPT='${INSTALL}'
    INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
    INTERP_SUPPORTED_FALSE=''
    INTERP_SUPPORTED_TRUE=''
    INTL=''
    JIT_SUPPORTED_FALSE=''
    JIT_SUPPORTED_TRUE=''
    LD=''
    LDFLAGS='-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu -lmswsock -lws2_32 -lole32 -loleaut32 -lpsapi -lversion -ladvapi32 -lwinmm -lkernel32'
    LIBC=''
    LIBGC_CPPFLAGS=''
    LIBGC_LIBS=''
    LIBGC_STATIC_LIBS=''
    LIBICONV=''
    LIBMONO_LA=''
    LIBOBJS=''
    LIBS=''
    LIBTOOL=''
    LIPO=''
    LLVM_CFLAGS=''
    LLVM_CONFIG=''
    LLVM_CXXFLAGS=''
    LLVM_LDFLAGS=''
    LLVM_LIBS=''
    LN_S='cp'
    LOADED_LLVM_FALSE=''
    LOADED_LLVM_TRUE=''
    LTCOMPILE=''
    LTCXXCOMPILE=''
    LTLIBICONV=''
    LTLIBOBJS=''
    M68K_FALSE=''
    M68K_TRUE=''
    MAINT='#'
    MAINTAINER_MODE_FALSE=''
    MAINTAINER_MODE_TRUE='#'
    MAKEINFO='${SHELL} /home/sensei/Downloads/Builds/wine-mono/src/wine-mono-0.0.4/mono/missing --run makeinfo'
    MANIFEST_TOOL=''
    MIPS_FALSE=''
    MIPS_GCC_FALSE=''
    MIPS_GCC_TRUE=''
    MIPS_SGI_FALSE=''
    MIPS_SGI_TRUE=''
    MIPS_TRUE=''
    MKDIR_P='/bin/mkdir -p'
    MONO_DEBUGGER_SUPPORTED_FALSE=''
    MONO_DEBUGGER_SUPPORTED_TRUE=''
    MONO_DL_NEED_USCORE=''
    MONO_NACL_ALIGN_MASK_OFF=''
    MOONLIGHT_BOEHM_FALSE=''
    MOONLIGHT_BOEHM_TRUE=''
    MOONLIGHT_DEFINES=''
    MOONLIGHT_FALSE=''
    MOONLIGHT_SGEN_FALSE=''
    MOONLIGHT_SGEN_TRUE=''
    MOONLIGHT_TRUE=''
    MSGFMT=''
    MSGFMT_015=''
    MSGMERGE=''
    NACL_CODEGEN_FALSE=''
    NACL_CODEGEN_TRUE=''
    NM=''
    NMEDIT=''
    NO_VERSION_SCRIPT_FALSE=''
    NO_VERSION_SCRIPT_TRUE=''
    OBJDUMP=''
    OBJEXT=''
    ONLY_MOONLIGHT_FALSE=''
    ONLY_MOONLIGHT_TRUE=''
    OPROFILE_CFLAGS=''
    OPROFILE_LIBS=''
    OTOOL64=''
    OTOOL=''
    PACKAGE='mono'
    PACKAGE_BUGREPORT='http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono'
    PACKAGE_NAME='mono'
    PACKAGE_STRING='mono 2.11.1'
    PACKAGE_TARNAME='mono'
    PACKAGE_URL=''
    PACKAGE_VERSION='2.11.1'
    PATH_SEPARATOR=':'
    PKG_CONFIG='false'
    PLATFORM_ANDROID_FALSE=''
    PLATFORM_ANDROID_TRUE='#'
    PLATFORM_DARWIN_FALSE=''
    PLATFORM_DARWIN_TRUE='#'
    PLATFORM_LINUX_FALSE=''
    PLATFORM_LINUX_TRUE='#'
    PLATFORM_SIGPOSIX_FALSE=''
    PLATFORM_SIGPOSIX_TRUE='#'
    POWERPC64_FALSE=''
    POWERPC64_TRUE=''
    POWERPC_FALSE=''
    POWERPC_TRUE=''
    RANLIB=''
    S390_FALSE=''
    S390_TRUE=''
    S390x_FALSE=''
    S390x_TRUE=''
    SED=''
    SET_MAKE=''
    SGEN_DEFINES=''
    SHARED_MONO_FALSE=''
    SHARED_MONO_TRUE=''
    SHELL='/bin/sh'
    SPARC64_FALSE=''
    SPARC64_TRUE=''
    SPARC_FALSE=''
    SPARC_TRUE=''
    SQLITE3=''
    SQLITE=''
    STATIC_MONO_FALSE=''
    STATIC_MONO_TRUE=''
    STRIP='strip'
    SUPPORT_BOEHM_FALSE=''
    SUPPORT_BOEHM_TRUE=''
    SUPPORT_SGEN_FALSE=''
    SUPPORT_SGEN_TRUE=''
    TARGET_WIN32_FALSE='#'
    TARGET_WIN32_TRUE=''
    USE_BATCH_FILES_FALSE=''
    USE_BATCH_FILES_TRUE=''
    USE_JIT_FALSE=''
    USE_JIT_TRUE=''
    USE_NLS=''
    VERSION='2.11.1'
    X11=''
    X86_FALSE=''
    X86_TRUE=''
    XATTR_LIB=''
    XGETTEXT=''
    XGETTEXT_015=''
    XGETTEXT_EXTRA_OPTIONS=''
    XMKMF=''
    ac_ct_AR=''
    ac_ct_CC='gcc'
    ac_ct_CXX=''
    ac_ct_DUMPBIN=''
    am__EXEEXT_FALSE=''
    am__EXEEXT_TRUE=''
    am__fastdepCCAS_FALSE=''
    am__fastdepCCAS_TRUE=''
    am__fastdepCC_FALSE=''
    am__fastdepCC_TRUE=''
    am__fastdepCXX_FALSE=''
    am__fastdepCXX_TRUE=''
    am__include=''
    am__isrc=' -I$(srcdir)'
    am__leading_dot='.'
    am__nodep=''
    am__quote=''
    am__tar='tar --format=ustar -chf - "$$tardir"'
    am__untar='tar -xf -'
    arch_target=''
    bindir='${exec_prefix}/bin'
    build='x86_64-unknown-linux-gnu'
    build_alias='x86_64-unknown-linux-gnu'
    build_cpu='x86_64'
    build_os='linux-gnu'
    build_vendor='unknown'
    datadir='${datarootdir}'
    datarootdir='${prefix}/share'
    docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
    docs_dir=''
    dvidir='${docdir}'
    exec_prefix='NONE'
    export_ldflags=''
    host='x86_64-w64-mingw32'
    host_alias='x86_64-w64-mingw32'
    host_cpu='x86_64'
    host_os='mingw32'
    host_vendor='w64'
    htmldir='${docdir}'
    ikvm_native_dir=''
    includedir='${prefix}/include'
    infodir='${datarootdir}/info'
    install_sh='${SHELL} /home/sensei/Downloads/Builds/wine-mono/src/wine-mono-0.0.4/mono/install-sh'
    libdir='${exec_prefix}/lib'
    libexecdir='${exec_prefix}/libexec'
    libgc_dir=''
    libgdiplus_loc=''
    libmono_cflags='-mno-cygwin -mms-bitfields -mwindows'
    libmono_ldflags='-mno-cygwin -mms-bitfields -mwindows'
    libsuffix=''
    localedir='${datarootdir}/locale'
    localstatedir='${prefix}/var'
    mandir='${datarootdir}/man'
    mcs_topdir=''
    mcs_topdir_from_srcdir=''
    mkdir_p=''
    mono_build_root=''
    mono_cfg_dir=''
    mono_runtime=''
    oldincludedir='/usr/include'
    pdfdir='${docdir}'
    prefix='/home/sensei/Downloads/Builds/wine-mono/src/wine-mono-0.0.4/build-cross-x86_64-install'
    program_transform_name='s&^&x86_64-w64-mingw32-&'
    psdir='${docdir}'
    reloc_libdir='lib'
    sbindir='${exec_prefix}/sbin'
    sharedstatedir='${prefix}/com'
    subdirs=''
    sysconfdir='${prefix}/etc'
    target='x86_64-w64-mingw32'
    target_alias='x86_64-w64-mingw32'
    target_cpu='x86_64'
    target_os='mingw32'
    target_vendor='w64'
    ## confdefs.h. ##
    /* confdefs.h */
    #define PACKAGE_NAME "mono"
    #define PACKAGE_TARNAME "mono"
    #define PACKAGE_VERSION "2.11.1"
    #define PACKAGE_STRING "mono 2.11.1"
    #define PACKAGE_BUGREPORT "http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono"
    #define PACKAGE_URL ""
    #define PACKAGE "mono"
    #define VERSION "2.11.1"
    #define HOST_WIN32 1
    #define DISABLE_PORTABILITY 1
    #define PLATFORM_NO_SYMLINKS 1
    #define TARGET_WIN32 1
    #define MINGW_CROSS_COMPILE 1
    configure: exit 77
    My makepkg.conf:
    # /etc/makepkg.conf
    # SOURCE ACQUISITION
    #-- The download utilities that makepkg should use to acquire sources
    # Format: 'protocol::agent'
    #DLAGENTS=('ftp::/usr/bin/wget -4 -c --passive-ftp -t 3 --waitretry=3 -O %o %u'
    # 'http::/usr/bin/wget -c -t 3 --waitretry=3 -O %o %u'
    # 'https::/usr/bin/wget -c -t 3 --waitretry=3 --no-check-certificate -O %o %u'
    #Curl as default DLAGENT
    DLAGENTS=('ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
    'http::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
    'https::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
    'rsync::/usr/bin/rsync -z %u %o'
    'scp::/usr/bin/scp -C %u %o')
    # Other common tools:
    # /usr/bin/snarf
    # /usr/bin/lftpget -c
    # /usr/bin/curl
    # ARCHITECTURE, COMPILE FLAGS
    CARCH="x86_64"
    CHOST="x86_64-unknown-linux-gnu"
    #-- Exclusive: will only run on x86_64
    # -march (or -mcpu) builds exclusively for an architecture
    # -mtune optimizes for an architecture, but builds for whole processor family
    CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
    CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
    LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu"
    #-- Make Flags: change this for DistCC/SMP systems
    #MAKEFLAGS="-j2"
    I am running a x64 arch with multilib and multilib-testing enabled. This is the first time I have encountered this error. Thank you in advance for all advice and suggestions.
    Edited: added makepkg.conf
    Last edited by mynameisneo (2012-06-13 19:04:09)

    In your config.log:
    /usr/bin/ld: cannot find -lmswsock
    /usr/bin/ld: cannot find -lws2_32
    /usr/bin/ld: cannot find -lole32
    /usr/bin/ld: cannot find -loleaut32
    /usr/bin/ld: cannot find -lpsapi
    /usr/bin/ld: cannot find -lversion
    /usr/bin/ld: cannot find -ladvapi32
    /usr/bin/ld: cannot find -lwinmm
    /usr/bin/ld: cannot find -lkernel32
    Try find these files which package provides!
    Edit: maybe package 'wine' provides this but as I see these libs are in /usr/lib/wine.
    Last edited by uzsolt (2012-06-13 18:07:08)

  • Error While Executing Sqlplus from shell

    I am trying to execute the below shell script with out back ticks(`${ORACLE_HOME}/bin/sqlplus) while calling sqlplus in the below code. When i do that all the next lines after that are changing to red color in vi and when i execute the script i am getting an error as "syntax error: unexpected end of file". may i know i please know what could be the issue? i suspect it could be because of EOF, when i have the backticks on it is executing fine.
    #!/bin/bash
    logit "Updating the Validation Status Field in ${DBSTGUSER}.FEED_PROCESS_LOG Table as RUNNING With Matching Parameters"
            logit "UNINUM :: ${UNINUM} PROVIDER :: ${PROVIDER} EXTRACT_DT :: ${EXTRACT_DT} VER_NUM :: ${VER_NUM}"
            `${ORACLE_HOME}/bin/sqlplus ${DBSTGUSER}/${DBSTGPASS}@${DBSRC} <<EOF > ${UPD_FEED_PROC_LOG}
            spool ${UPD_SQL1}
            UPDATE ${DBSTGUSER}.FEED_PROCESS_LOG SET VALIDATION_STATUS='RUNNING'
            WHERE UNINUM='${UNINUM}' and PROVIDER='${PROVIDER}' and EXTRACT_DT='${EXTRACT_DT}'
            and VER_NUM=${VER_NUM} and ACT_END_DT IS NULL  AND (VALIDATION_STATUS IS NULL OR VALIDATION_STATUS='RUNNING');
            spool off;
            COMMIT;
            EXIT;
            EOF`
            if grep -q "ERROR" ${UPD_FEED_PROC_LOG}
            then
                    logit "Error While Updating the ${DBSTGUSER}.FEED_PROCESS_LOG Table"
                    logit "Please Check ${UPD_FEED_PROC_LOG} Log File For Detailed Information"
                    exit 3
            else
                    logit "Updation Of ${DBSTGUSER}.FEED_PROCESS_LOG Table Completed Successfully"
                    logit "Please Check ${UPD_FEED_PROC_LOG} Log File For Detailed Information"
            fi

    Ariean wrote:
    I thought forum will have people with mixed skills (sql/scripting) they would be able to quickly point me to right direction. There is no problem is with RDBMS!
    I know EOF stands for End of file and i am piping the data into the program (sqlplus).You could just as well use "FUBAR" in place of EOF; which just happens to be some arbitrary string.
    piping ("|") is NOT involved , as in env | sort
    you don't know, what you don't know.

  • Grep Command in Linux

    Hi all,
    I having problem getting the output of grep command in Linux (Red Hat 9.0).
    At the same time, I am able to get the output of cat command.
    Using the output of cat command, I am writing it to a text file and then in another process using grep I am extracting particular line from the text file.
    To get the Process Output I am using a code from http://hacks.oreilly.com/pub/h/1092#thread.
    Below is my code.
    public void getUSBInfo() {     
           try{
                  String catCommand =  "cat /proc/bus/usb/devices";
                  System.out.println("catCommand is : "+catCommand);
                  Process p = Runtime.getRuntime().exec(catCommand);
                  usbInfoBuffer = new StringBuffer("");
                  InputStream inStream = p.getInputStream();
                  new InputStreamHandler( usbInfoBuffer, inStream ); 
                                  // InputStreamHandler is the class used to read the console output.
                  StringBuffer errBuffer = new StringBuffer();
                  InputStream errStream = p.getErrorStream();
                  new InputStreamHandler( errBuffer , errStream );
                  p.waitFor();
                  catCommandOutput = usbInfoBuffer.toString();
                  System.out.println("USB Info : " +catCommandOutput);
                  String fileCat ="/EthicsPoint/usbInfo.txt";
                  File catCommandOutputFile =  new File(fileCat);
                  boolean filesuccess = catCommandOutputFile.createNewFile();
                  setContents(catCommandOutputFile,catCommandOutput);
                  extractUSBInfo();
                  }catch(Exception e) {
                 JOptionPane.showMessageDialog(null," Exception occured executing Native Method..catCommand.."                                         ,epname,JOptionPane.ERROR_MESSAGE);                                    System.out.println("File Exception No 6" +e);
    public void extractUSBInfo() {
         try {
              String filename = " /EthicsPoint/usbInfo.txt";
              String grepCommand = "grep \"P:\\|S:\""+filename ;
               //String[] grepCommand = new String[]{"grep", "\"P:\\|S:\"", "/EthicsPoint/usbInfo.txt"};
              Process p = Runtime.getRuntime().exec(grepCommand);
              usbExtractedInfoBuffer = new StringBuffer("");
              InputStream inStream = p.getInputStream();
              new InputStreamHandler( usbExtractedInfoBuffer, inStream );
              StringBuffer errBuffer = new StringBuffer();
              InputStream errStream = p.getErrorStream();
              new InputStreamHandler( errBuffer , errStream );
              p.waitFor();
              String Output = usbExtractedInfoBuffer.toString();
              System.out.println("grepCommand is    : " +grepCommand);
              System.out.println("Searched USB Info : " +Output);
          }catch(Exception e) {
         JOptionPane.showMessageDialog(null," Exception occured executing Native Method..grepCommand..."                               ,epname,JOptionPane.ERROR_MESSAGE);                                    System.out.println("File Exception No 7" +e);
          }I am not getting any IOException. The output of System.out.println("Searched USB Info : " +Output); is blank.
    If I try shell> grep "P:\|S:" /EthicsPoint/usbInfo.txt, I get the desired output.
    What could be the reason ? While using cat command I am getting the output , but grep command is
    returning blank. I even tried String array[] for exec() command, but still get blank.
    Where and what I am doing wrong ?
    Thanks in advance.
    Regards,
    Jay.

    Hi asjf,
    Thanks a lot... The problem is finally solved.
    String exeCommand = "grep P:\\|S: "+filename; I removed the quotes and it worked. But if I
    remove backslash for the pipe symbol nothing happens..as I get return value of 1.
    Output after removing quotes :
    exeCommand is : grep P:\|S:  /EthicsPoint/usbInfo.txt
    Exit Value is : 0
    USB Info : P:  Vendor=0000 ProdID=0000 Rev= 0.00
    S:  Product=USB OHCI Root Hub
    S:  SerialNumber=ce84b000
    P:  Vendor=0000 ProdID=0000 Rev= 0.00
    S:  Product=USB OHCI Root Hub
    S:  SerialNumber=ce849000But I have noticed another problem. If I execute the aplication number of times, eventhough
    the exit value is 0, USB Info : is blank. This happens sometimes. Sometimes I get the correct output.
    What could be the reason ?
    Thanks to you and all who have replied to my queries....Thanks a lot.....Really appreciate the time and effort.
    Regards,
    Jay.

  • [SOLVED]C compiler cannot create executables DUE TO MISSING DEV. PACKS

    Hi there, I was trying to build "lib32-libpcap" from AUR using yaourt when the gcc(?) reported an error as following:
    ==> Starting build()...
    checking build system type... x86_64-unknown-linux-gnu
    checking host system type... x86_64-unknown-linux-gnu
    checking target system type... x86_64-unknown-linux-gnu
    checking for gcc... gcc -m32
    checking for C compiler default output file name...
    configure: error: C compiler cannot create executables
    See `config.log' for more details.
    ==> ERROR: A failure occurred in build().
    Aborting...
    The content of the "config.log" file:
    This file contains any messages produced by compilers while
    running configure, to aid debugging if configure makes a mistake.
    It was created by configure, which was
    generated by GNU Autoconf 2.61. Invocation command line was
    $ ./configure --prefix=/usr --libdir=/usr/lib32 --enable-ipv6
    ## Platform. ##
    hostname = mzws
    uname -m = x86_64
    uname -r = 3.2.8-1-ARCH
    uname -s = Linux
    uname -v = #1 SMP PREEMPT Mon Feb 27 21:51:46 CET 2012
    /usr/bin/uname -p = unknown
    /bin/uname -X = unknown
    /bin/arch = x86_64
    /usr/bin/arch -k = unknown
    /usr/convex/getsysinfo = unknown
    /usr/bin/hostinfo = unknown
    /bin/machine = unknown
    /usr/bin/oslevel = unknown
    /bin/universe = unknown
    PATH: /usr/local/bin
    PATH: /usr/bin
    PATH: /bin
    PATH: /usr/local/sbin
    PATH: /usr/sbin
    PATH: /sbin
    PATH: /usr/bin/core_perl
    ## Core tests. ##
    configure:1794: checking build system type
    configure:1812: result: x86_64-unknown-linux-gnu
    configure:1834: checking host system type
    configure:1849: result: x86_64-unknown-linux-gnu
    configure:1871: checking target system type
    configure:1886: result: x86_64-unknown-linux-gnu
    configure:2036: checking for gcc
    configure:2063: result: gcc -m32
    configure:2301: checking for C compiler version
    configure:2308: gcc -m32 --version >&5
    gcc (GCC) 4.6.2 20120120 (prerelease)
    Copyright (C) 2011 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    configure:2311: $? = 0
    configure:2318: gcc -m32 -v >&5
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.2/lto-wrapper
    Target: x86_64-unknown-linux-gnu
    Configured with: /build/src/gcc-4.6-20120120/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --enable-libstdcxx-time --enable-gnu-unique-object --enable-linker-build-id --with-ppl --enable-cloog-backend=isl --enable-lto --enable-gold --enable-ld=default --enable-plugin --with-plugin-ld=ld.gold --disable-multilib --disable-libssp --enable-checking=release
    Thread model: posix
    gcc version 4.6.2 20120120 (prerelease) (GCC)
    configure:2321: $? = 0
    configure:2328: gcc -m32 -V >&5
    gcc: error: unrecognized option '-V'
    gcc: fatal error: no input files
    compilation terminated.
    configure:2331: $? = 1
    configure:2354: checking for C compiler default output file name
    configure:2381: gcc -m32 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu conftest.c >&5
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.2/libgcc.a when searching for -lgcc
    /usr/bin/ld: cannot find -lgcc
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.2/../../../libgcc_s.so when searching for -lgcc_s
    /usr/bin/ld: skipping incompatible /usr/lib/libgcc_s.so when searching for -lgcc_s
    /usr/bin/ld: cannot find -lgcc_s
    collect2: ld returned 1 exit status
    configure:2384: $? = 1
    configure:2422: result:
    configure: failed program was:
    | /* confdefs.h. */
    | #define PACKAGE_NAME ""
    | #define PACKAGE_TARNAME ""
    | #define PACKAGE_VERSION ""
    | #define PACKAGE_STRING ""
    | #define PACKAGE_BUGREPORT ""
    | /* end confdefs.h. */
    |
    | int
    | main ()
    | {
    |
    | ;
    | return 0;
    | }
    configure:2429: error: C compiler cannot create executables
    See `config.log' for more details.
    ## Cache variables. ##
    ac_cv_build=x86_64-unknown-linux-gnu
    ac_cv_env_CC_set=set
    ac_cv_env_CC_value='gcc -m32'
    ac_cv_env_CFLAGS_set=set
    ac_cv_env_CFLAGS_value='-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2'
    ac_cv_env_CPPFLAGS_set=
    ac_cv_env_CPPFLAGS_value=
    ac_cv_env_CPP_set=
    ac_cv_env_CPP_value=
    ac_cv_env_LDFLAGS_set=set
    ac_cv_env_LDFLAGS_value=-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu
    ac_cv_env_LIBS_set=
    ac_cv_env_LIBS_value=
    ac_cv_env_build_alias_set=
    ac_cv_env_build_alias_value=
    ac_cv_env_host_alias_set=
    ac_cv_env_host_alias_value=
    ac_cv_env_target_alias_set=
    ac_cv_env_target_alias_value=
    ac_cv_host=x86_64-unknown-linux-gnu
    ac_cv_prog_ac_ct_CC='gcc -m32'
    ac_cv_target=x86_64-unknown-linux-gnu
    ## Output variables. ##
    ADDLARCHIVEOBJS=''
    ADDLOBJS=''
    BT_SRC=''
    CAN_SRC=''
    CC='gcc -m32'
    CFLAGS='-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2'
    CPP=''
    CPPFLAGS=''
    DEFS=''
    DYEXT=''
    ECHO_C=''
    ECHO_N='-n'
    ECHO_T=''
    EGREP=''
    EXEEXT=''
    GREP=''
    HAVE_LINUX_TPACKET_AUXDATA=''
    INSTALL_DATA=''
    INSTALL_PROGRAM=''
    INSTALL_SCRIPT=''
    LDFLAGS='-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu'
    LIBOBJS=''
    LIBS=''
    LTLIBOBJS=''
    MAN_FILE_FORMATS=''
    MAN_MISC_INFO=''
    OBJEXT=''
    PACKAGE_BUGREPORT=''
    PACKAGE_NAME=''
    PACKAGE_STRING=''
    PACKAGE_TARNAME=''
    PACKAGE_VERSION=''
    PATH_SEPARATOR=':'
    PCAP_SUPPORT_BT=''
    PCAP_SUPPORT_CAN=''
    PCAP_SUPPORT_USB=''
    RANLIB=''
    SHELL='/bin/sh'
    SHLICC2=''
    SSRC=''
    USB_SRC=''
    V_CCOPT='-O'
    V_DEFS=''
    V_FINDALLDEVS=''
    V_INCLS=''
    V_LEX=''
    V_PCAP=''
    V_RPATH_OPT=''
    V_SHLIB_CMD=''
    V_SHLIB_OPT=''
    V_SONAME_OPT=''
    V_YACC=''
    ac_ct_CC='gcc -m32'
    bindir='${exec_prefix}/bin'
    build='x86_64-unknown-linux-gnu'
    build_alias=''
    build_cpu='x86_64'
    build_os='linux-gnu'
    build_vendor='unknown'
    datadir='${datarootdir}'
    datarootdir='${prefix}/share'
    docdir='${datarootdir}/doc/${PACKAGE}'
    dvidir='${docdir}'
    exec_prefix='NONE'
    host='x86_64-unknown-linux-gnu'
    host_alias=''
    host_cpu='x86_64'
    host_os='linux-gnu'
    host_vendor='unknown'
    htmldir='${docdir}'
    includedir='${prefix}/include'
    infodir='${datarootdir}/info'
    libdir='/usr/lib32'
    libexecdir='${exec_prefix}/libexec'
    localedir='${datarootdir}/locale'
    localstatedir='${prefix}/var'
    mandir='${datarootdir}/man'
    oldincludedir='/usr/include'
    pdfdir='${docdir}'
    prefix='/usr'
    program_transform_name='s,x,x,'
    psdir='${docdir}'
    sbindir='${exec_prefix}/sbin'
    sharedstatedir='${prefix}/com'
    sysconfdir='${prefix}/etc'
    target='x86_64-unknown-linux-gnu'
    target_alias=''
    target_cpu='x86_64'
    target_os='linux-gnu'
    target_vendor='unknown'
    ## confdefs.h. ##
    #define PACKAGE_NAME ""
    #define PACKAGE_TARNAME ""
    #define PACKAGE_VERSION ""
    #define PACKAGE_STRING ""
    #define PACKAGE_BUGREPORT ""
    configure: exit 77
    and the makepkg.conf:
    # /etc/makepkg.conf
    # SOURCE ACQUISITION
    #-- The download utilities that makepkg should use to acquire sources
    # Format: 'protocol::agent'
    DLAGENTS=('ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
    'http::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
    'https::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
    'rsync::/usr/bin/rsync -z %u %o'
    'scp::/usr/bin/scp -C %u %o')
    # Other common tools:
    # /usr/bin/snarf
    # /usr/bin/lftpget -c
    # /usr/bin/wget
    # ARCHITECTURE, COMPILE FLAGS
    CARCH="x86_64"
    CHOST="x86_64-unknown-linux-gnu"
    #-- Compiler and Linker Flags
    # -march (or -mcpu) builds exclusively for an architecture
    # -mtune optimizes for an architecture, but builds for whole processor family
    CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
    CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
    LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu"
    #-- Make Flags: change this for DistCC/SMP systems
    #MAKEFLAGS="-j2"
    # BUILD ENVIRONMENT
    # Defaults: BUILDENV=(fakeroot !distcc color !ccache check !sign)
    # A negated environment option will do the opposite of the comments below.
    #-- fakeroot: Allow building packages as a non-root user
    #-- distcc: Use the Distributed C/C++/ObjC compiler
    #-- color: Colorize output messages
    #-- ccache: Use ccache to cache compilation
    #-- check: Run the check() function if present in the PKGBUILD
    #-- sign: Generate PGP signature file
    BUILDENV=(fakeroot !distcc color !ccache check !sign)
    #-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
    #-- specify a space-delimited list of hosts running in the DistCC cluster.
    #DISTCC_HOSTS=""
    #-- Specify a directory for package building.
    #BUILDDIR=/tmp/makepkg
    # GLOBAL PACKAGE OPTIONS
    # These are default values for the options=() settings
    # Default: OPTIONS=(strip docs libtool emptydirs zipman purge !upx)
    # A negated option will do the opposite of the comments below.
    #-- strip: Strip symbols from binaries/libraries
    #-- docs: Save doc directories specified by DOC_DIRS
    #-- libtool: Leave libtool (.la) files in packages
    #-- emptydirs: Leave empty directories in packages
    #-- zipman: Compress manual (man and info) pages in MAN_DIRS with gzip
    #-- purge: Remove files specified by PURGE_TARGETS
    #-- upx: Compress binary executable files using UPX
    OPTIONS=(strip docs libtool emptydirs zipman purge !upx)
    #-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
    INTEGRITY_CHECK=(md5)
    #-- Options to be used when stripping binaries. See `man strip' for details.
    STRIP_BINARIES="--strip-all"
    #-- Options to be used when stripping shared libraries. See `man strip' for details.
    STRIP_SHARED="--strip-unneeded"
    #-- Options to be used when stripping static libraries. See `man strip' for details.
    STRIP_STATIC="--strip-debug"
    #-- Manual (man and info) directories to compress (if zipman is specified)
    MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
    #-- Doc directories to remove (if !docs is specified)
    DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
    #-- Files to be removed from all packages (if purge is specified)
    PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
    # PACKAGE OUTPUT
    # Default: put built package and cached source in build directory
    #-- Destination: specify a fixed directory where all packages will be placed
    #PKGDEST=/home/packages
    #-- Source cache: specify a fixed directory where source files will be cached
    #SRCDEST=/home/sources
    #-- Source packages: specify a fixed directory where all src packages will be placed
    #SRCPKGDEST=/home/srcpackages
    #-- Packager: name/email of the person or organization building packages
    #PACKAGER="John Doe <[email protected]>"
    #-- Specify a key to use for package signing
    #GPGKEY=""
    # EXTENSION DEFAULTS
    # WARNING: Do NOT modify these variables unless you know what you are
    # doing.
    PKGEXT='.pkg.tar.xz'
    SRCEXT='.src.tar.gz'
    # vim: set ft=sh ts=2 sw=2 et:
    Am running a up-to-date x64 Arch with [multilib] enabled; perhaps it's a silly mistake I made somewhere but I'm no dev and so cannot figure out what went wrong in the config.log....please help with your kindness and thanks in advance!
    Last edited by karbon (2012-03-10 04:28:58)

    Thanks for your replies:)
    Allan wrote:Are you really up-to-date?   gcc-4.6.3 was put in [core] four days ago but you still seem to have 4.6.2.
    Well...at least as up-to-date as on March 2nd(when I did last system-wide upgrade); trying to update system tonight to see whether this works.
    stronnag wrote:If you have multilib and testing enabled, you also need  multilib-testing, otherwise (as I know from bitter experience), you get these hard to track down errors.
    Nope I didn't enable [testing]; I've discovered some packages in [multilib], namely gcc-multilib or something similar(with the -multilib subfix) and some of these packages belong to the group "multilib-devel". Is installing these packages a must for compiling 32-bit packages?

  • Runtime.exec() fails sometime to execute a command

    Hello,
    I have a program thats using Runtime.exec to execute some external programs sequence with some redirection operators.
    For e.g, I have some command as follows;
    1 - C:\bin\IBRSD.exe IBRSD -s
    2 - C:\bin\mcstat -n @punduk444:5000#mc -l c:\ | grep -i running | grep -v grep |wc -l
    3 - ping punduk444 | grep "100%" | wc -l
    ...etc.
    These command in sequence for a single run. The test program makes multiple such runs. So my problem is sometimes the runtime.exec() fails to execute some of the commands above (typically the 2nd one). The waitFor() returns error code (-1). That is if I loop these commands for say 30 runs then in some 1~4 runs the 2nd command fails to execute and return -1 error code.
    Can some one help me out to as why this is happening? Any help is appreciated
    Thanks,
    ~jaideep
    Herer is the code snippet;
    Runtime runtime = Runtime.getRuntime();
    //create process object to handle result
    Process process = null;
    commandToRun = "cmd /c " + command;
    process = runtime.exec( commandToRun );
    CommandOutputReader cmdError = new CommandOutputReader(process.getErrorStream());
    CommandOutputReader cmdOutput = new CommandOutputReader(process.getInputStream());
    cmdError.start();
    cmdOutput.start();
    CheckProcess chkProcess = new CheckProcess(process);
    chkProcess.start();
    int retValue = process.waitFor();
    if(retValue != 0)
    return -1;
    output = cmdOutput.getOutputData();
    cmdError = null;
    cmdOutput = null;
    chkProcess = null;
    /*******************************supporting CommandOutputReader class *********************************/
    public class CommandOutputReader extends Thread
    private transient InputStream inputStream; //to get output of any command
    private transient String output; //output will store command output
    protected boolean isDone;
    public CommandOutputReader()
    super();
    output = "";
    this.inputStream = null;
    public CommandOutputReader(InputStream stream)
    super();
    output = "";
    this.inputStream = stream;
    public void setStream(InputStream stream)
    this.inputStream = stream;
    public String getOutputData()
    return output;
    public void run()
    if(inputStream != null)
    final BufferedReader bufferReader = new BufferedReader(new InputStreamReader(inputStream), 1024 * 128);
    String line = null;
    try
    while ( (line = bufferReader.readLine()) != null)
    if (ResourceString.getLocale() != null)
    Utility.log(Level.DEBUG,line);
    //output += line + System.getProperty(Constants.ALL_NEWLINE_GETPROPERTY_PARAM);
    output += line + "\r\n";
    System.out.println("<< "+ this.getId() + " >>" + output );
    System.out.println("<< "+ this.getId() + " >>" + "closed the i/p stream...");
    inputStream.close();
    bufferReader.close();
    catch (IOException objIOException)
    if (ResourceString.getLocale() != null)
    Utility.log(Level.ERROR, ResourceString.getString("io_exeception_reading_cmd_output")+
    objIOException.getMessage());
    output = ResourceString.getString("io_exeception_reading_cmd_output");
    else
    output = "io exeception reading cmd output";
    finally {
    isDone = true;
    public boolean isDone() {
    return isDone;
    /*******************************supporting CommandOutputReader class *********************************/
    /*******************************supporting process controller class *********************************/
    public class CheckProcess extends Thread
    private transient Process monitoredProcess;
    private transient boolean continueLoop ;
    private transient long maxWait = Constants.WAIT_PERIOD;
    public CheckProcess(Process monitoredProcess)
    super();
    this.monitoredProcess = monitoredProcess;
    continueLoop =true;
    public void setMaxWait(final long max)
    this.maxWait = max;
    public void stopProcess()
    continueLoop=false;
    public void run()
    //long start1 = java.util.Calendar.getInstance().getTimeInMillis();
    final long start1 = System.currentTimeMillis();
    while (true && continueLoop)
    // after maxWait millis, stops monitoredProcess and return
    if (System.currentTimeMillis() - start1 > maxWait)
    if(monitoredProcess != null)
    monitoredProcess.destroy();
    //available for garbage collection
    // @PMD:REVIEWED:NullAssignment: by jbarde on 9/28/06 7:29 PM
    monitoredProcess = null;
    return;
    try
    sleep(1000);
    catch (InterruptedException e)
    if (ResourceString.getLocale() != null)
    Utility.log(Level.ERROR, ResourceString.getString("exception_in_sleep") + e.getLocalizedMessage());
    System.out.println(ResourceString.getString("exception_in_sleep") + e.getLocalizedMessage());
    else
    System.out.println("Exception in sleep" + e.getLocalizedMessage());
    if(monitoredProcess != null)
    monitoredProcess.destroy();
    //available for garbage collection
    // @PMD:REVIEWED:NullAssignment: by jbarde on 9/28/06 7:29 PM
    monitoredProcess = null;
    /*******************************supporting process controller class *********************************/

    Hi,
    Infact the command passed to the exec() is in the form of a batch file, which contains on of these commands. I can not put all commands in one batch file due to inherent nature of the program.
    But my main concern was that, why would it behave like this. If I run the same command for 30 times 1~3 times the same command can not be executed (returns with error code 1, on wiun2k pro) and rest times it works perfectly fine.
    Do you see any abnormality in the code.
    I ahve used the same sequence of code as in the article suggested by
    "masijade". i.e having threads to monitor the process and other threads to read and empty out the input and error streams so that the buffer does not get full.
    But I see here the problem is not of process getting hanged, I sense this because my waitFor() returns with error code as 1, had the process hanged it would not have returned , am I making sense?
    Regards,
    ~jaideep

  • Problem with GREP finding

    Hi Experts
    I am trying to find text using GREP option:
    <k6>
    para 1
    para 2
    para 3
    </k6>
    using this grep function
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.findWhat = "(?s)<k6>\r(.+?\r)</k6>";
    var myResults = app.activeDocument.findGrep();
    while I am executing this script the end of paragraph marker "\r" automatically changed to SPACE( ) in the FIND/CHANGE dialogue box. If i change the space manually to \r in find/change dialogue box it works fine. Why executing from script this changes happen? Any one experienced this before.
    Kindly suggest.
    Thanks in advance

    You mean the input appears to have changed to a space when you check what's in the Find box? That is normal behavior. Since you are using Javascript strings, codes such as "\t" and "\r" are *immediately* translated into their literal characters *before* being processed any further. So you don't write "\r" into the Find dialog, you are writing a literal hard return character. The Find/Change dialog cannot show that character on screen so it displays a space.
    You say "if I change it to \r it works fine" -- do you mean that it does *not* work if you leave it that way? Because it should work just fine. (And you actually can have a little fun by inserting all kinds of 'special' characters literally into the Find dialog -- try tab or newline.)
    But if it bothers you for cosmetic reasons, use "\\r" instead. The double backslash is also a special Javascript string escape and will be replaced (immediately) with a single backslash. Then the string that goes into the Find dialog is "\r", and that's what InDesign is going to translate back to a hard return when it's processing your find string.

  • Shell Script to grep Job File name and Log File name from crontab -l

    Hello,
    I am new to shell scripting. I need to write a shell script where i can grep the name of file ie. .sh file and log file from crontab -l.
    #51 18 * * * /home/oracle/refresh/refresh_ug634.sh > /home/oracle/refresh/refresh_ug634.sh.log 2>&1
    #40 17 * * * /home/oracle/refresh/refresh_ux634.sh > /home/oracle/refresh/refresh_ux634.sh.log 2>&1
    In crontab -l, there are many jobs, i need to grep job name like 'refresh_ug634.sh' and corresponding log name like 'refresh_ug634.sh.log '.
    I am thinking of making a universal script that can grep job name, log name and hostname for one server.
    Then, suppose i modify the refresh_ug634.sh script and call that universal script and echo those values when the script gets executed.
    Please can anyone help.
    All i need to do is have footer in all the scripts running in crontab in one server.
    job file name
    log file name
    hostname
    Please suggest if any better solution. Thanks.

    957704 wrote:
    I need help how to grep that information from crontab -l
    Please can you provide some insight how to grep that shell script name from list of crontab -l jobs
    crontab -l > cron.log -- exporting the contents to a file
    cat cron.log|grep something -- need some commands to grep that infoYou are missing the point. This forum is for discussion of SQL and PL/SQL questions. What does your question have to do with SQL or PL/SQL.
    It's like you just walked into a hardware store and asked where they keep the fresh produce.
    I will point out one thing about your question. You are assuming every entry in the crontab has exactly the same format. consider this crontab:
    #=========================================================================
    # NOTE:  If this is on a clustered environment, all changes to this crontab
    #         must be replicated on all other nodes of the cluster!
    # minute        (0 thru 59)
    # hour          (0 thru 23)
    # day-of-month  (1 thru 31)
    # month         (1 thru 12)
    # weekday       (0 thru 6, sunday thru saturday)
    # command
    #=========================================================================
    00 01 1-2 * 1,3,5,7 /u01/scripts/myscript01  5 orcl  dev
    00 04 * * * /u01/scripts/myscript02 hr 365 >/u01/logs/myscript2.lis
    00 6 * * * /u01/scripts/myscript03  >/u01/logs/myscript3.lisThe variations are endless.
    When you get to an appropriate forum (this on is not it) it will be helpful to explain your business requirement, not just your proposed technical solution.

Maybe you are looking for