Using Shell commands in AWK

Hi, i want to use tr command in awk. Please guide me. Also, how to use shell variables in awk?

please help

Similar Messages

  • Printing PDF file Using Shell Command Line

    Hello I am writing  a program from MicroSoft Excel's Macro that will print PDF files. I have managed to get the program to work but I cannot prevent the file not being opened. Basically the PDF file would get printed but the file would automatically opened up.
    I am using shell command line to write this. And this is my code:
    FileName = "C:\EGB Gaming Lab\Training Manual\Testing Documents\Testing Checklists\Bill Validator*"
    myShell.Run ("Acrobat.exe /t" & FileName)
    I have tried using /h but it still opens the file.
    I am referring to this support case:
    http://support.adobe.com/devsup/devsup.nsf/docs/52080.htm
    Thank you

    You may be able to adopt this script:
    on open dropped_items
       -- Write a message into the event log.
       log "  --- Starting on " & ((current date) as string) & " --- "
       -- set see to alias "Macintosh-HD:Users:mac:Desktop:app.html"
       -- set dropped_items to {see}
       set the_app to "Safari"
       repeat with dropped_item_ref in dropped_items
          --set UrlBase to "xzzx FILE://" & POSIX path of dropped_item_ref
          --display dialog UrlBase
          -- Activate
          activate application the_app
          -- Open the URL 
          tell application the_app
             open dropped_item_ref
             -- print dropped_item_ref
             tell application "System Events"
                tell process the_app
                   delay 3
                   -- click menu item "Print..." of menu "File" of menu bar 1
                   keystroke "p" using command down
                   delay 1
                   keystroke return
                   delay 10
                   keystroke "w" using command down
                end tell
             end tell
             --quit
          end tell
       end repeat
    end open

  • How to generate "CertificateSigningRequest" by using shell command

    Hi,
    I want to create "CertificateSigningRequest" file by using shell command
    We can create this csr file by using keychain.
    Keychain Access/Certificate Assistant/Request a certification from a Certificate Authroity
    I really need your help.
    Thanks
    Meng

    Hi,
    Thanks for your message.
    Yes, it is self-signed Certificate Authrity.
    If it is very easy and free, please let me know.
    Thanks
    Meng

  • Deploy and runnig app on ipad using shell command or others

    Hello,
    How to deploy and run an app from Mac on an iPad using a shell command or others like a program in c or objective-c.
    Thank you in advance
    Mickael

    These libraries are developed by us for iOS and automatically built every day.
    After each building we must launch this application (iOS) tests that implements our libraries.
    we would like to automate the deployment of this app and its execution on an iPAD connected via USB cable to the Mac of production.

  • Can oracle starts ctxsrv? Not using shell command

    I am wondering if ctxsrv can be started by oracle procedure calls.
    Once I restart oracle, I don't have to start ctxsrv manually( sometimes just forgot to do so ).

    Go to the services in the control pannel, then select the perticular servide select there the service select properties with right click, and then change the Service start type from manual to automatic.
    thats all
    regards,
    khaleel

  • Applescript MySQL interface (No... not using the shell command)

    I'm a windows guy, so please be gentle if I sound noobish.
    I'm trying to automate an export of the System Profiler info to a MySQL database directly, and I was hoping to get applescript to parse the info from the XML and push it into MySQL.
    Now I know that Applescript can manipulate MySQL by using shell commands for the MySQL command line client, but I was hoping that someone knew of a native applescript interface.

    There's MacSQL http://www.macupdate.com/info.php/id/21293 that will give an alternative route into MySQL. I don't know whether it's any better than using shell scripts.

  • ACS 4.0, only 1 Shell Command auth. set possible

    Hi all,
    I am wondering if this is a "hidden feature" of the evaluation software or a bug...
    I am currently running Cisco Acs server v.4.0 (evaluatie version) Win2k3 platform; with authentication, authorization and accouting.
    In a nutshell I have the following setup:
    - group1 uses: Shell Command Authorization Set1
    - group2 uses: Shell Command Authorization Set2
    Problem: Users in group2 are somehow authorized against the commands listed in Shell Auth. Comm. set1 instead of the configured Shell Auth. Comm. set2
    Is it possible that with the evaluation software only one Shell Command Authorization Set is allowed to be active? Does anyone know?
    Many thx
    Sander

    Problem resolved by renaming authorization sets and reloading ACS......
    thx Sander

  • AAA with CatOS and ACS (shell command autorization set)

    Hi,
    I have an ACS that authenticates and authorizes IOS devices.
    I use "shell command autorization set" to authorize some commands for some groups.
    Is it possible to do so with CatOS?
    For example, I'd like that the groupe FULL can access all command and the group LOW can onmy access "sho" commands?
    Regards,
    ROMS

    Console> (enable) set tacacs server [IP] [primary]
    set tacacs key [key]
    set tacacs attempts [number] (optional)
    set localuser user [user] password [password] privilege 15
    set authentication login local enable
    set authentication login tacacs enable [all | console | http | telnet] [primary]
    set authorization exec enable tacacs+ [deny | none] [console | telnet | both]
    set authorization commands enable [config | all] tacacs+ [deny | none] [console |telnet | both]
    regards,
    ~JG

  • Run shell commands using java program

    Hi guys,
    I am trying to run shell commands like cd /something and ./command with arguments as follows, but getting an exception that ./command not found.Instead of changing directory using "cd" command I am passing directory as an argument in rt,exec().
    String []cmd={"./command","arg1", "arg2", "arg3"};
    File file= new File("/path");
    try{
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(cmd,null,file);
    proc.waitFor();
    System.out.println(proc.exitValue())
    BufferedReader buf = new BufferedReader(new InputStreamReader(proc.getInputStream()));
    catch(Exception e)
    {e.printStackTrace();
    So can anyone please tell me what is wrong with this approach? or is there any better way to do this?
    Thanks,
    Hardik

    warnerja wrote:
    What gives you the idea that the process to execute is called "./command"? If this is in Windows, it is "cmd.exe" for example.It does not have to be cmd.exe in Windows. Any executable or .bat file can be executed as long as one either specifies the full path or the executable is in a directory that is in the PATH.
    On *nix the file has to have the executable bit set and one either specifies the full path or the executable must be in a directory that is in the PATH . If the executable is a script then if there is a hash-bang (#!) at the start of the first line then the rest of the line is taken as the interpreter  to use. For example #!/bin/bash or #!/usr/bin/perl .
    One both window and *nix one can exec() an interpreter directly and then pass the commands into the process stdin. The advantage of doing this is that one can change the environment in one line and it  remains in effect for subsequent line. A simple example of this for bash on Linux is
    import java.io.OutputStreamWriter;
    import java.io.Writer;
    public class ExecInputThroughStdin
        public static void main(String args[]) throws Exception
            final Process process = Runtime.getRuntime().exec("bash");
            new Thread(new PipeInputStreamToOutputStreamRunnable(process.getErrorStream(), System.err)).start();
            new Thread(new PipeInputStreamToOutputStreamRunnable(process.getInputStream(), System.out)).start();
            final Writer stdin = new OutputStreamWriter(process.getOutputStream());
            stdin.write("xemacs&\n");
            stdin.write("cd ~/work\n");
            stdin.write("dir\n");
            stdin.write("ls\n");
            stdin.write("gobbldygook\n"); // Forces output to stderr
            stdin.write("echo $PATH\n");
            stdin.write("pwd\n");
            stdin.write("df -k\n");
            stdin.write("ifconfig\n");
            stdin.write("echo $CWD\n");
            stdin.write("dir\n");
            stdin.write("cd ~/work/jlib\n");
            stdin.write("dir\n");
            stdin.write("cat /etc/bash.bashrc\n");
            stdin.close();
            final int exitVal = process.waitFor();
            System.out.println("Exit value: " + exitVal);
    }One can use the same approach with Windows using cmd.exe but then one must be aware of the syntactic differences between commands running in .bat file and command run from the command line. Reading 'help cmd' s essential here.
    The class PipeInputStreamToOutputStreamRunnable in the above example just copies an InputStream to an OutputStream and I use
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    public class PipeInputStreamToOutputStreamRunnable implements Runnable
        public PipeInputStreamToOutputStreamRunnable(InputStream is, OutputStream os)
            is_ = is;
            os_ = os;
        public void run()
            try
                final byte[] buffer = new byte[1024];
                for (int count = 0; (count = is_.read(buffer)) >= 0;)
                    os_.write(buffer, 0, count);
            } catch (IOException e)
                e.printStackTrace();
        private final InputStream is_;
        private final OutputStream os_;
    }

  • Exchange 2013 CU5 , Exchange Power Shell very very very slow reasponse when using get command.

    Exchange 2013 CU5 , Exchange Power Shell very very very slow reasponse when using get command.
    First my organize has Exchange on 2 site like
    site A (internet facing) : 2CAS 2 MB all are Services pack1
    site B (DR Site , no user active on this site) : 2CAS 2MB all are Services pack 1
    so today I upgrade Exchange 2013 from SP1 to CU5 start on "site B" and I found this issue and the details is....
    When I open EMS on any CU5 for query something (like get-mailboxdatabasecopystatus) the response return very slow and some query will not return at all (like get-owavirtualdirectory).
    But If I using EMS on SP1. Everything is ok then I try to use EMS on SP1 connect to CU5 and try to query something. the result is
    some query command cannot return for any result that are server on siteB (just some query command)
    Problem
    EMS on CU5 return very slow result.
    EMS on SP1 still ok.
    Does anyone face this problem before for CU5??? Please help me figure this out. Thank you
    reply from Social.technet

    Hi,
    Have you used the above cmdlets to check your Exchange server health?
    "all other command that I ran on EMS didn't logged on event viewer.", my environment is the same with you. I use Exchange 2013, only errors will be displayed in MSExchange Management. Actually, it is not related to slow EMS response.
    Hope it helps.
    Best regards,
    Amy Wang
    TechNet Community Support

  • Run a shell command using Pl/Sql

    hi all
    i wonder if anyone knows a way to run a shell command using pl/sql
    other than java stored procedure
    as it seems not to be working in my case
    thanx in advance,
    Rasha

    ofcourse not
    i sent it once then i've got disconnected from interent then i reconnected
    and resend my question so it was sent twice
    now i hope you can answer my question !!!
    Do you really think when asking twice or more often you will get a quicker answer?

  • LabView equivalent to running batch files using the "shell" command (VisualBasic)

    I'm converting a VisualBasic app to LabView and am having trouble figuring out how to run a batch file with LabView.
    The VB code that I'm trying to replicate is:
    'UNLOAD RTX DRIVERS
    Dim ProcessId As Long
    ProcessId = Shell(App.Path + "\UnloadReloadRTX.bat", vbNormalFocus)
    Wait 400
    I haven't found a LabView equivalent to the Shell command. Any suggestions will be appreciated.
    thanks,
    Todd

    It seems as if this question pops up every week. Use the System Exec.vi found under Funtions - Communications palette. It is the equivalent of Shell.
    - tbob
    Inventor of the WORM Global

  • [Solved] stumpwm: how to get rid of newline using run-shell-command

    Hi all,
    in order to set up my mode-line for stumpwm, I've been using the commad
    run-shell-command such as in:
    (setf *screen-mode-line-format*
    (list
    '(:eval (run-shell-command "date" t))
    '(:eval (run-shell-command "date" t))))
    However, each instance of run-shell-command creates an unnecessary
    newline (so that my mode line contains two lines without necessity).
    Do you know how I can get rid of this newline?
    Thanks!
    Last edited by falsum (2011-05-23 07:12:27)

    jiyuu wrote:
    I didn't test it but the function you want is 'string-trim' or 'string-right-trim'.
    You use it like this:
    (string-trim '(#\Newline) my-string)
    So in your case:
    (setf *screen-mode-line-format*
    (list
    '(:eval (string-trim '(#\Newline)
    (run-shell-command "date" t)))
    '(:eval (run-shell-command "date" t))))
    That works perfectly well. Thanks a lot jiyuu!!

  • Power Shell Command using CSOM

    Hi,
    We have prepared a Power Shell command using Client Side scripts as per client requirements. The client did not had access to the SharePoint Server. So, PS commands with
    server side scripts was out of scope. 
    The client requirement was to delete all the permissions on the list that was being inherited from site. Since the number of users were huge, so deleting all the users using ribbon was not possible.
    Please have a look at the scripts below and let me know your feedback. If you have better suggestion than this, please let me know.
    #location of client dlls on users' local system
    $loc = "C:\SharePoint\ClientDLL" 
    //SharePoint Site URL
    $siteUrl = "" 
    #Write your Login ID
    $loginname = "" 
    #Write the Name of the List
    $listname = "" 
    Set-Location $loc 
    Add-Type -Path (Resolve-Path "Microsoft.SharePoint.Client.dll")
    Add-Type -Path (Resolve-Path "Microsoft.SharePoint.Client.Runtime.dll") 
    Write-Host "Please enter password for $($siteUrl):"
    $pwd = Read-Host -AsSecureString
    $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl) 
    Try
    # Remove or replace line below to change authentication method
    $ctx.Credentials = New-Object System.Net.NetworkCredential($loginname, $pwd) 
    $web = $ctx.Web
    $ctx.Load($web)
    $ctx.ExecuteQuery() 
    #Write-Host "Current web title is '$($web.Title)', $($web.Url)"  
    $list = $Web.Lists.GetByTitle($listname); 
    $ctx.Load($list); 
    $ctx.ExecuteQuery(); 
    Write-Host "Deleting Permissions on List : $($list.Title)" 
    if($list.HasUniquePermissions)
                    #Write-Host "Has Unique Permissions"
                    $list.ResetRoleInheritance()
                    $list.BreakRoleInheritance($false, $true)
                    Write-Host "Permissions deleted" -foregroundcolor Green
    if(-not $list.HasUniquePermissions)
                    #Write-Host "Does not has Unique Permissions"
                    $list.ResetRoleInheritance()
                    $list.BreakRoleInheritance($false, $true)
                    Write-Host "Permissions deleted" -foregroundcolor Green
    Catch
                    Write-Host "Some Error, Please Contact Administrator" -foregroundcolor Red
                    return
    $list.Update() 
    $ctx.ExecuteQuery();​
    Regards,
    Sudheer
    Thanks & Regards, Sudheer

    Hi Sudheer,
    In Client-Side, we can also use .NET Client Object Model to achieve your requirement.
    Remove permission in Sharepoint List using Client Object Model
    https://rambabualaparthi.wordpress.com/2013/12/30/remove-permission-in-sharepoint-list-using-client-object-model/
    In order to better manage SharePoint in Client side, I suggest develop a Winform or WPF application and use .Net Client Object Model to achieve some requirements.
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Shell Command Authorization Sets for device using NDGs??

    Hello. I NDGs configured, there is a group called "GR1" with 30 switch.
    This group is set up a Shell Command Authorization set called "Monitoring", in which only show commands, ping and traceroute are allowed.
    I want to let users switch in only 10 of the group "GR 1" to configure certain interfaces and IP addresses, switch to the other not. ! Note: The number of interface is not the same for each switch, one can be FA0 / 1, but for others it may fa0/3.etc.
    I want to retain these 10 switch within the group "GR1", it is possible to make this configuration?
    - Thanks

    I've edited my earlier post to make it more clear. You can assign Shell Auth. Sets at the user,group or NDG level.More details are mentioned on the following link:
    http://www.cisco.com/en/US/docs/net_mgmt/cisco_secure_access_control_server_for_windows/4.2/user/guide/SPC.html#wpmkr697610
    AFAIR, one device (AAA Client) can be part of only one NDG, so you cannot achieve your requirement by using per-NDG Shell Command Authorization sets. Unless you break up the NDG into more than one NDG.
    You can assign the authorization set at the user or group level (after putting the appropriate users in the group) to achive your requirement.
    You could also use the 'privilege' command on the switch to make sure that users can see only the commands you want. E.g. when a user logs in he will be placed at level 7. Now you can keep the undesired commands at level 15 and bring down the desired commands at level 7. All other users would be assigned a lower level (e.g level 5), so they wont be able to run these commands.
    Regards
    Farrukh

Maybe you are looking for

  • MBean Attribute (Does not apply to application modules)

    Can any one tell what this mean ? MBean Attribute (Does not apply to application modules) : is this means that it wont help for datasources for any J2EE application ???? Inactive Connection Timeout      The number of inactive seconds on a reserved co

  • Creating a folder for wallpaper on the phone?

    Hey guys, As per the topic really, how do I create a folder on the phone for my wallpaper? I can't see an option in explorer to add a new folder Thanks

  • Filr 1.1 initial config not picking up RAW LUN for storage

    HI All, When i run the initial install, the gilr appliance wont pickup the raw lun (esxi.5.5) to cinfigure for data storage, but when i finish the install and go to yast, i can in partitiona manager create the partition, how can i trigger the initial

  • "Length is too big" IOException when using OpenSSL key/certs

    Using WLS 5.1, SP6, Solaris Hello one and all: I am trying to test WLS with SSL. I am using the OpenSSL package to act as my own CA and generate and sign my own server certs. I don't have any problem with this part. However, when I try to use my priv

  • New output needed for posted invoice

    Hi all, The company I am working for posted an invoice via MIRO but there was no output determination configured. This invoice was posted for last year however they now need to print an output for their records. Is it possible to do this? Thanks for