Is there a way to reference bnd filename from a macro inside? - osgi

I would like to use the filename of a sub-bundle bnd file as value without extension inside the file itself. like here ${filename_without_extension}
Is there a opportunity for that?
file: core.bnd
-includeresource: \
#${filename_without_extension}.jar

${thisfile} gives you the file of the current bnd file. You can substitute the '.bnd' extension:
fname = ${subst;${thisfile};\.bnd$;.jar}
-includeresource: #${fname}

Related

How to write output file of ruby code into specific directory/location?

I have ruby code which will create output file, currently file is creating at location from where my script is running.
I have to write output file to different location so i am specifying explicit path into code. but it's not able to create file. my code looks like :
fname = "C:\repo\cookbooks\abc\recipes\add.rb"
somefile = File.open(fname,"w")
somefile.puts "end"
somefile.close
If i specify
fname = "add.rb"
it's working but i want to create it at different location as i mentioned above code in C:\ drive.
Because \ in strings are special characters so you should use \\ (double backslashes) to get a single backslash. But there is a better way, you don't need to deal with backslashes at all:
fname = File.join("C:", "repo", "cookbooks", "abc", "recipes", "add.rb")

how to get `zip` to add .zip extension when the filename is constructed from a variable

If I run...
$ myTest="bar"
$ zip -r foo-${myTest} path/*
...then I get a zip file named foo-bar.zip. (note the .zip extension!) However, if I run...
$ myTest="1.0.1"
$ zip -r foo-${myTest} path/*
...then I get a zip file named foo-1.0.1. (no .zip extension!)
I can obviously add .zip to my script, but I would like to understand what is going on here. Why doesn't zip add the extension when the filename is built from a variable with numbers in it?
It dawned on me as I wrote that last question that this isn't about numbers. Quoting from man zip:
If the name of the zip archive does not contain an extension, the extension .zip is added. If the name already contains an extension other than .zip, the existing extension is kept unchanged. However, split archives (archives split over multiple files) require the .zip extension on the last split.
The problem is that I have .'s in the variable, which zip interprets as filename extensions. Luckily, my script constructs the variable with .'s so I can confidently add .zip to the end. Otherwise, I would need to test for .'s to name the file correctly.

Fail to Download File Using Jmeter

http://blazemeter.com/blog/how-performance-test-upload-and-download-scenarios-apache-jmeter
I've used above link for reference.
I'm Using Save Responses to a file with Download call.
But fail to Download file.
Can anyone tell me What Exactly i need Specify in
FileName Prefix:
Variable name :
and where to Specify download location ?
Provide absolute file path with a file name.
FileName Prefix: c:\workspace\jmeter-download\myfile
For ex: If your test is downloading a pdf file, you would see a 'myfile.pdf' under 'c:\workspace\jmeter-download'
I've used path like D:/xyzFolder/filename as Filename Prifix
it's working fine for me
and if any one wants file to download in same Dir in which your jmx file is
then just need to use ~/pre as Filename Prifix

What is wrong in the for loop I use to create a file source=dest list?

I try to loop over the file I findin a relative path to build a list of relative path/soure file name=source file name
SHARED_LIB_PACK=""
for LIB in $(find ../level1/leve2/ -name "*.so*")
do
$SHARED_LIB_PACK=$SHARED_LIB_PACK" "$LIB"="${LIB##*/}
done
but as I run it, it complain :
line 6: = ../level1/level2/file.so.1.0=file.so.1.0: No such file or directory
Any help will be welcome
Firstly, variable assignment is done via:
FOO="bar"
and not
$FOO="bar"
The former will not work.
Secondly, your quotes seem to be in strange places:
SHARED_LIB_PACK=$SHARED_LIB_PACK" "$LIB"="${LIB##*/}
should probably be
LIB="${LIB##*/}"
SHARED_LIB_PACK="$SHARED_LIB_PACK $LIB"
or
SHARED_LIB_PACK="$SHARED_LIB_PACK ${LIB##*/}"

File locations in shell script property files

I have a property looks like below in property file and the properties are ready by "sourcing" in shell script.
MW_INSTALLER_11.6="/ade_autofs/scratch/test/installer/wls_generic.jar"
During sourcing, observing the below error and the variable is not read.
Where all other properties are read perfectly fine.
./upgrade.properties: line 45: MW_INSTALLER_11.6=/ade_autofs/scratch/test/installer/wls_generic.jar: No such file or directory
The file mentioned above is present specified path. Observing same issue with or without double quotes.
What is the right way to add the file location in property file?
Code around above specified property in property files
POST_UPGRADE_ANT_OPTIONS=
MW_INSTALLER_11.6="/ade_autofs/scratch/test/installer/wls_generic.jar"
NO_OF_RELEASES_TO_UPGRADE=1
Code around sourcing property file in shell script, here $1 represents property file
echo "Reading properties file $1" | tee -a $LOG_DRIVER_FILE
. ./$1
UPGRADE_PROPERTIES_FILE=$1
thanks In Advance, soman
I found the issue. Issue is due to the variable name contains "." [dot]
after changing from MW_INSTALLER_11.6="/ade_autofs/scratch/test/installer/wls_generic.jar"
to
MW_INSTALLER_11_6="/ade_autofs/scratch/test/installer/wls_generic.jar"
It worked fine.
Regards.

Resources