LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cp $@ ~/backup (https://www.linuxquestions.org/questions/linux-newbie-8/cp-%24%40-%7E-backup-4175454942/)

jcky 03-21-2013 12:45 AM

cp $@ ~/backup
 
Hello all,

cp $@ ~/backup

This command executed not successfully but the book <<Linux shell cookbook>> did this.

Who can help me to explain what's the meaing of this command and waht's $@ ?

Thanks

chrism01 03-21-2013 01:39 AM

Section 3.2.5 http://tldp.org/LDP/Bash-Beginners-G...ml#table_03_01

shivaa 03-21-2013 02:13 AM

I guess, it's a part of some script. The $@ is used for positional parameters, starting from one. For example you invoke:
Code:

~$ ./script file1 file2...
Then $@ means "file1 file2..." i.e.
Code:

cp file1 file2... ~/backup

kooru 03-21-2013 03:52 AM

http://www.gnu.org/software/bash/man...Shell-Features
section - 3.2.5. Special parameters


All times are GMT -5. The time now is 03:03 PM.