Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does @D mean in shell script

Tags:

shell

i have a code as

   echo -e "\\n" "=====  Making: $(@D)\n";\
    if [ ! -d $(@D) ]; then \
            mkdir $(@D); \
    else \
            if [ -e $(@D)\PackageBuild.error ]; then \
                    rm $(@D)\PackageBuild.error;\
            fi; \

i am not sure what this @D is doing. can someone help me out here

like image 596
anonymous Avatar asked Mar 07 '17 10:03

anonymous


People also ask

What is @d in make file?

' $(@D) ' The directory part of the file name of the target, with the trailing slash removed. If the value of ' $@ ' is dir/foo.o then ' $(@D) ' is dir .

What does $() mean bash?

Example of command substitution using $() in Linux: Again, $() is a command substitution which means that it “reassigns the output of a command or even multiple commands; it literally plugs the command output into another context” (Source).

What is bash if [- D?

In order to check if a directory exists in Bash, you have to use the “-d” option and specify the directory name to be checked. if [[ -d "$DIRECTORY" ]] then echo "$DIRECTORY exists on your filesystem." fi. As an example, let's say that you want to check with Bash if the directory /etc exists on your system.

What is $@ and $* in shell script?

• $* - It stores complete set of positional parameter in a single string. • $@ - Quoted string treated as separate arguments. • $? - exit status of command.


1 Answers

Usually $(command) executes command and replaces $(command) with the output of command. So there must be a file named @D which is executable and located in the search path.

But if this is not a shell script but a make file it means:

$(@D)

The directory part of the file name of the target, with the trailing slash removed. If the value of $@ is dir/foo.o then $(@D) is dir. This value is . if $@ does not contain a slash.

like image 82
D. Mika Avatar answered Nov 02 '22 05:11

D. Mika