Welcome to forums, hope you will enjoy learning here. It is called Parameter expansion, when you do a man bash you could see the following.
Quote:
${parameter##word}
Remove matching prefix pattern. The word is expanded to produce a pattern just as in pathname expansion. If the pattern matches the
beginning of the value of parameter, then the result of the expansion is the expanded value of parameter with the shortest matching pat-
tern (the ‘‘#’’ case) or the longest matching pattern (the ‘‘##’’ case) deleted. If parameter is @ or *, the pattern removal operation
is applied to each positional parameter in turn, and the expansion is the resultant list. If parameter is an array variable subscripted
with @ or *, the pattern removal operation is applied to each member of the array in turn, and the expansion is the resultant list.
Here is an example of same too.
So let's say we have following string into a variable.
So here is the use of # and ##.
As you could see above(selected text will not be shown) # is removing the text till very first space and on other hand ## is printing the text till very last(maximum) match of space. I hope this helps you.
Thanks,
R. Singh
These 2 Users Gave Thanks to RavinderSingh13 For This Post:
Hello
I was wondering what this file type means...
assuming it is some type of data.
Is ldp - Linux Doc Program?
What type of program would be used to read or interpret this file type?
As you can see I'm not a developer, and don't review these
types of files. But would like to view... (1 Reply)
Hello.
I'm looking at a file that has a ; at the beginning of certain lines. Could someone please tell me what that means? Is it a comment? Is it an execute?
Thank You (1 Reply)
Hi all,
I am sorry, I know this is not correct forum/silly question (usually this is requirement in some vacancies), but i hope someone can explain to me, what is the meaning of :
SUN Tier 3 Support
Tier 3 Application Installation
Level 2 Solaris
Level 2 AD MOM + DBA
Thank you. (0 Replies)
All,
I have a line in my code like below , could any one please tell me what this actually mean what is the & doding there.
I am in sh shell
#!/bin/sh
..............
mv &fname &III.tar.gz
Thanks in Advance,
Arun (1 Reply)
All,
In the below mentioned piece of code :
if test $# -eq 1
then
echo "Input parameter passed into DMI_weekly.ksh..." | tee -a $RUNLOG
typeset -u ORACLE_SID
export ORACLE_SID="$1"
else
echo "ERROR 060: Arguments passed... (3 Replies)
Hi,
Can someone help me with the meaning of each term in the below command in unix:
stty-aRegds,
I have searched google for a lot for this, but didnt get any success in this.
Kunwar (2 Replies)
Hello. In some script, I saw:
filename=${1:-/etc/hosts}
if && ; then
md5sum $filename
else
echo “$filename can not be processed”
fi
# Show the file if possible
ls -ld $filename 2>/dev/null
What does the first line means? In $filename I still got /etc/hosts. (2 Replies)
What would the below code snippet mean?
my ($_configParam, $_paramValue) = split(/\s*=\s*/, $_, 2);
$configParamHash{$_configParam} = $_paramValue; (2 Replies)
Please let me understand the meaning of following line in unix bash scripting .is =~ means not equal to or equal to .
if ]; then
echo -e "pmcmd startworkflow -sv ${INTSERV} -d ${INFA_DEFAULT_DOMAIN} -uv INFA_DEFAULT_DOMAIN_USER" \
"-pv INFA_DEFAULT_DOMAIN_PASSWORD -usdv... (2 Replies)