I make this script that uses "strace" to trace programs. The script looks for files that the program opens. It looks like this
I want to extract the path without the quotes, preferably using grep and cut, but it can be also sed or awk (I just don't know these much). I worked out a regular expression egrep -o "\(\"[^\"]*\"," | cut -f 2 -d \" but then I realized the path can contain characters like " as well.
I thought the solution could look something like this egrep -o "\(\"[^{[^\\]\",[:space:]}]*\"," (any characters except string "[^\\]\",[:space:]" and these characters repeating)... Because I found out that strace doesn't work correctly if "\" without quotes is at the end of the file. So I thought I could use it as a benefit. However, it doesn't work .. I'm not very good in regular expressions indeed.
EDIT: And I'm sorry ... [:space:] is not the solution, because the script should work in FreeBSD as well and it uses "truss" instead of "strace" and there's no space after ",
Last edited by Yogesh Sawant; 03-24-2010 at 11:02 PM..
Reason: added code tags
I need to extract a file,which contains the path to a new path.
sample tar file
tar -tfv class.tar | grep client
-rw------- 0/1 99 Jan 22 12:46 2004 /usr/openv/netbackup/db/class/mariner/clients
-rw------- 0/1 102 Sep 25 11:33 2007... (1 Reply)
Im trying to extract a directory from a path entered by the user
Lets say the path is
path=/home/bliss/files/myfile.txt
i wanna extract "/home/bliss/files" from $path ... how can i do this? (4 Replies)
Hi all,
I know this has been covered a lot, I have been searching and reading for hours on the subject, however so far I have been unsuccessful at accomplishing the goal using sed.
I know this can be done with parameter expansion (Thanks cfajohnson for a great explanation of parameter... (5 Replies)
Hi,
I have a environmental variables,
ORACLE_HOME=/u01/oracle/ORCL/db/tech/10.2.0
ORACLE_SID=ORCL
Now I need to create a variable and need to extract some part from ORACLE_HOME. I need to get the path from ORACLE_HOME till ORACLE_SID as /u01/oracle/ORCL. I may need to check also... (6 Replies)
Hi,
Could anyone help me in writing a single line code by either using (sed, awk, perl or whatever) to extract a specific path from the PATH environment variable?
for eg: suppose the PATH is being set as follows
PATH=/usr/bin/:/usr/local/bin:/bin:/usr/sbin:/usr/bin/java:/usr/bin/perl3.4
... (2 Replies)
hello,
i have a configuration file app.conf under /tmp, containing values like :
param1=/data/something
param2=/data/somethingelse
i have a bash script that has to list the files under the path that corresponds to param2 :
#!/bin/bash
dir=$(cat tmp/app.conf | grep param2 | sed ... (6 Replies)
Hi all,
i've a string
$DIR=/u/user/NDE/TEST_LOGS/20110622_000005_TEST_11_HD_120/HD/TEST_11_HD_120/hd-12
i need to extract string from 2011.... i.e i need it as 20110622_000005_TEST_11_HD_120 as matched string, and in turn i need to split values 20110622_000005_TEST_11_HD_120 into two.... (6 Replies)
Hi everyone,
I have different folders which looks like this:
/mnt/ecrm/master/ecrm/templates/brochure/de_DE/zeitlos.ott
/mnt/ecrm/master/ecrm/templates/mail/en_US/default.html
/templates/header_and_footer/en_US/default.txt
I want to get the bold text only in a variable. I already have a... (3 Replies)
i was attempting to extract a directory path that was passed from a parameter with this code
vdir=`dirname $p1`
echo current directory $vdir
it does not work when the parameter passed has wild card on it.
for example
$ sh sample1.sh "/sbin/log/c*.log"
dirname: extra operand... (2 Replies)
Discussion started by: wtolentino
2 Replies
LEARN ABOUT DEBIAN
makensis
NSIS(1) makensis NSIS(1)NAME
makensis - A program to create Windows installers.
SYNOPSIS
makensis [script.nsi] [-CMDHELP item] [-HDRINFO] [-LICENSE] [-VERSION] [-Vx] [-Ofile] [-PAUSE] [-NOCONFIG] [-NOCD] [-Ddefine=value]
[-Xscriptcmd]
DESCRIPTION
This manual page documents briefly the makensis command.
This manual page was written for the Debian (TM) distribution because the original program does not have a manual page. Instead, it has
documentation in the HTML format; see below.
makensis is a program that creates installer programs for Windows.
OPTIONS
Parameters are processed by order (-Ddef ins.nsi != ins.nsi -Ddef) for script file name, you can use - to read from the standard input. For
a complete description, see the HTML files.
-Vx
Verbosity where x is 4=all, 3=no script, 2=no info, 1=no warnings, 0=none.
-Ofile
Specifies a text file to log compiler output (default is stdout).
-PAUSE
Pauses after execution.
-NOCONFIG
Disables inclusion of /etc/nsisconf.nsh.
-NOCD
Disable changing the current directory to that of the .nsi file.
-Ddefine=value
Defines the symbol "define" for the script to [value].
-Xscriptcmd
Executes scriptcmd in the script (i.e. "-XOutFile poop.exe")
-CMDHELP item
Prints out help for 'item', or lists all commands.
-HDRINFO
Prints information about what options makensis was compiled with.
-LICENSE
Prints the makensis software license.
-VERSION
Prints the makensis version and exits.
FILES
/etc/nsisconf.nsh
System wide configuration file.
~/.nsisconf.nsh
Per-user configuration file.
SEE ALSO
NSIS is documented more fully in the HTML files in /usr/share/doc/nsis/Docs.
AUTHOR
This manual page was written by Paul Wise pabs@debian.org for the Debian (TM) system.
AUTHOR
Paul Wise
Created man page
COPYRIGHT
Copyright (C) 2005 Paul Wise
makensis manual October 5, 2005 NSIS(1)