LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-05-2010, 04:55 PM   #16
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556

Quote:
Originally Posted by colucix View Post
Maybe cp is aliased to 'cp -i' (I remember in old unix machines this was a default or just an habit of system administrators - I don't know exactly). Davide, the command
Code:
type cp
should tell you if cp is actually aliased.
@ colucix--

great, thanks, I never even thought of that.

For comparison sake, here's what I get on my system:

Code:
bash-3.1# type cp
cp is /bin/cp
bash-3.1
 
Old 01-06-2010, 08:35 AM   #17
davide123
Member
 
Registered: Jan 2010
Location: tampa bay fl
Distribution: fedora redhat 9 10 11 12 13 &14 x86_64 & i686; Peppermint, MintOne; RHEL 4 5 6, Ubuntu, SliTaz etc,
Posts: 102

Original Poster
Rep: Reputation: 16
ok tried that-
cp is aliased to 'cp -i'
what does that mean?

my script is running good now, im getting the output from what comes up in my screen using
Code:
yes| cp -LRuvpf /dir/filename /mnt/usbdrive/filename >/usbdrive/error.log 2>&1
what does "2&1" actually mean?

what i want to do is have a file after my script runs to show me the succesful completion and errors from each command. using the above command creates a file with all output from the command being executed

thanks for all the help
 
Old 01-06-2010, 08:46 AM   #18
internetplayer
LQ Newbie
 
Registered: Jan 2010
Posts: 5

Rep: Reputation: 0
Without the -i option, and without the --reply option, but WITH the -f option, it should not be asking you *anything* -- it should just DO it..

i have tryt that and it does work you can use that simple way
 
Old 01-06-2010, 09:04 AM   #19
davide123
Member
 
Registered: Jan 2010
Location: tampa bay fl
Distribution: fedora redhat 9 10 11 12 13 &14 x86_64 & i686; Peppermint, MintOne; RHEL 4 5 6, Ubuntu, SliTaz etc,
Posts: 102

Original Poster
Rep: Reputation: 16
see above reply internet player
 
Old 01-06-2010, 10:30 AM   #20
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Quote:
Originally Posted by davide123 View Post
ok tried that-
cp is aliased to 'cp -i'
what does that mean?
It means that: in your bash_profile or /etc/profile config file (or possible even by a symlink somewhere) an ALIAS is configured. An ALIAS is a way of creating a command, in a sense. Have a look at your shell's MAN PAGE to read about aliases.

Quote:
what does "2&1" actually mean?
There are two 'channels' of output of text, from a program; stdout, and stderr. stdout is the "standard output" where normal output shows up. stderr is "standard error" where errors are generated.
stdout is signified by &1, and stderr is signified by &2. By saying 2>&1, we are telling the shell to redirect stderr into stdout.

Again, your shell's MAN PAGE explains shell redirection.

Quote:

what i want to do is have a file after my script runs to show me the succesful completion and errors from each command. using the above command creates a file with all output from the command being executed

thanks for all the help
Not sure I follow the last part there, but try using `cat` and pipe it into `less` to view the log file after the copying is done:

shell# cat logfile | less

Sasha
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cp --reply=yes deprecated!! fredsub Linux - General 1 08-25-2008 09:43 PM
Non-deprecated version of cp --reply=no punt Linux - General 4 07-03-2007 06:04 AM
Subscribe to thread option on Quick Reply Matir LQ Suggestions & Feedback 6 02-15-2006 06:48 PM
sshd: Deprecated option ReverseMappingCheck kalahari875 Linux - Security 3 01-06-2005 08:10 PM
post reply & submit reply buttons annehoog LQ Suggestions & Feedback 10 01-05-2004 06:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration