how to get ? pub/static/frontend/Magento/luma/en_US/Namespace_Module/images/image.png - magento2.2

How to get this path ?
"pub/static/frontend/Magento/luma/en_US/Namespace_Module/images/image.png"

echo $block->getViewFileUrl('Vendor_Module::images/yourImage.jpg');

Related

How to extract a portion of the file name from a file path in bash

for name in $FASTQ_DIR/*/R1/*.fastq.gz
do
echo "$name"
done
/lustre/scratch119/realdata/mdt1/team113/projects/im13_basespace_runs/FASTQ/220800636_walk_up_431_miseq/R1/MISEQ_431_Plasmid_library_sample_01_S1_R1_001.fastq.gz
/lustre/scratch119/realdata/mdt1/team113/projects/im13_basespace_runs/FASTQ/220800636_walk_up_431_miseq/R1/MISEQ_431_Undetermined_S0_R1_001.fastq.gz
/lustre/scratch119/realdata/mdt1/team113/projects/im13_basespace_runs/FASTQ/241816583_walkup_194_hiseq_2500_repeat/R1/HISEQ_194_REPEAT_A01_FR_KAPA_25x_1ug_SR_1ngx4rxns_S1_R1_001.fastq.gz
/lustre/scratch119/realdata/mdt1/team113/projects/im13_basespace_runs/FASTQ/241816583_walkup_194_hiseq_2500_repeat/R1/HISEQ_194_REPEAT_A02_FR_KAPA_25x_2ug_SR_1ngx4rxns_S2_R1_001.fastq.gz
/lustre/scratch119/realdata/mdt1/team113/projects/im13_basespace_runs/FASTQ/241816583_walkup_194_hiseq_2500_repeat/R1/HISEQ_194_REPEAT_A03_FR_KAPA_25x_3ug_SR_1ngx4rxns_S3_R1_001.fastq.gz
/lustre/scratch119/realdata/mdt1/team113/projects/im13_basespace_runs/FASTQ/241816583_walkup_194_hiseq_2500_repeat/R1/HISEQ_194_REPEAT_A06_FR_KAPA_23x_3ug_SR_1ngx14rxns_S4_R1_001.fastq.gz
/lustre/scratch119/realdata/mdt1/team113/projects/im13_basespace_runs/FASTQ/241816583_walkup_194_hiseq_2500_repeat/R1/HISEQ_194_REPEAT_A10_FR_TAKARA_25x_1ug_SR_1ngx4rxns_S5_R1_001.fastq.gz
/lustre/scratch119/realdata/mdt1/team113/projects/im13_basespace_runs/FASTQ/241816583_walkup_194_hiseq_2500_repeat/R1/HISEQ_194_REPEAT_A11_FR_TAKARA_25x_2ug_SR_1ngx4rxns_S6_R1_001.fastq.gz
/lustre/scratch119/realdata/mdt1/team113/projects/im13_basespace_runs/FASTQ/241816583_walkup_194_hiseq_2500_repeat/R1/HISEQ_194_REPEAT_A12_FR_TAKARA_25x_3ug_SR_1ngx4rxns_S7_R1_001.fastq.gz
/lustre/scratch119/realdata/mdt1/team113/projects/im13_basespace_runs/FASTQ/241816583_walkup_194_hiseq_2500_repeat/R1/HISEQ_194_REPEAT_B03_FR_TAKARA_25x_3ug_SR_1ngx12rxns_S8_R1_001.fastq.gz
/lustre/scratch119/realdata/mdt1/team113/projects/im13_basespace_runs/FASTQ/241816583_walkup_194_hiseq_2500_repeat/R1/HISEQ_194_REPEAT_B05_Plasmid_DNA_KAPA_15x_5ng_SR_40pgx4rxns_S9_R1_001.fastq.gz
/lustre/scratch119/realdata/mdt1/team113/projects/im13_basespace_runs/FASTQ/241816583_walkup_194_hiseq_2500_repeat/R1/HISEQ_194_REPEAT_Undetermined_S0_R1_001.fastq.gz
For each file path, I would like to extract just:
HISEQ_194_REPEAT_A01_FR_KAPA_25x_1ug_SR_1ngx4rxns_S1
HISEQ_194_REPEAT_A02_FR_KAPA_25x_2ug_SR_1ngx4rxns_S2
etc.
How is this possible? Thanks
This worked to get the result I required:
for FILE_PATH in $FASTQ_DIR/R1/*.fastq.gz
do
FILE_NAME="$(basename "$FILE_PATH")"
SAMPLE=${FILE_NAME%_R1_001.fastq.gz}
done

GET path not accepting 'dot' in it

I have router path with a '.' in it, my path is downloads/pass.pkpass
I have defined the path in web.php as the following
$router->get('downloads/pass.pkpass', 'PassServerController#downloadPass');
but somehow it's not working. if I remove the '.' it's working fine. what might be the problem here?
It's was working before recently I updated lumen after that it's not working.
The . is the string concatenation operator in PHP.
example
<?php
$string1 = "Test";
$string2 = "working!";
$string = $string1 . $string2;
echo $string;
?>
this will print "Test working!"
You can get your route by this may be
$router->get('downloads/pass.'.'pkpass', 'PassServerController#downloadPass');
But this is some kind of hack we can say.
You can use _ instead of . parameter that will work for sure.

Customise My zsh Theme

Themes and I was wondering how can I make my ➜ start in a new line instead its between the $USER %M and pwd:
`function get_pwd() {
echo "${PWD/$HOME/~}"
}
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)
"PROMPT='%{$fg[white]%}$USER%{$fg[cyan]%}%M ${ret_status}%{$fg_bold[green]%}%p %{$fg[yellow]%}$(get_pwd)%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="❮ %{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}❯ %{$fg[yellow]%}%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}❯"
`
Okay I think I figured it out but I am not sure if its the proper way to do it any suggestions are welcome so basically I put the local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)
"PROMPT='%{$fg[white]%}$USER%{$fg[cyan]%}%M %{$fg[yellow]%}$(get_pwd)%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}
${ret_status}%{$fg_bold[green]%}%p % %{$reset_color%}'
You can find your answer in this post about ZSH NEWLINE options.

How To Echo If Variable = something?

#echo off
set/p=password
if %password%=random echo password correct
How Do I Echo It?
I Keep Getting An Error
Basically the syntay for if is:
if %variable%==content echo blabla
But you should write
if "%variable%"=="content" ....
to prevent a syntax error if the input is empty.

Bash - Echo a variable using another variable (?)

Thank you very much in advance for helping!
I have this variables:
scene1=lounge
scene2=bedroom
scene3=bathroom
What I want to do is a loop, and for every file in a particular folder, echo the variable scene#
order=1
for f in $(find $dest_scenes/*.xml -maxdepth 0 )
do
scene_name=scene$order #scene1, scene2, scene3
echo $scene_name
done
order=$(expr $order + 1)
Output:
scene1
scene2
scene3
What I would like to:
lounge
bedroom
bathroom
I don't want to get $scene_name, I want to got $($scene_name) if you know what I mean...
Thank you!!!
That's called variable interpolation. In your case, you could do:
echo ${!scene_name}
See How do I use a variable within a variable for more variations.

Resources