LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 12-02-2003, 08:30 PM   #1
Gerardoj
Member
 
Registered: May 2003
Location: Somewhere over the Rainbow
Distribution: Slackware 9.x, Knoppix, Damn Small Linux, RedHat.
Posts: 465

Rep: Reputation: 30
Trouble in Shell Script


Hi. Im creating a simple install shell script, but I have a problem that doesnt copy any GIF file, Im trying to copy all the contents of the NotepadIcons folder. The below code is part of my script. What could be the problem?

Thanks

Code:
su -c "mkdir -p /usr/share/NOTEPAD-EDITOR-1.01/NotepadIcons && cp *.gif "
 
Old 12-02-2003, 08:38 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,005
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
The problem is that you don't
cd into the directory, and that
cp doesn't have a target.



Cheers,
Tink
 
Old 12-02-2003, 08:40 PM   #3
LogicG8
Member
 
Registered: Jun 2003
Location: Long Island, NY
Distribution: Gentoo Unstable (what a misnomer)
Posts: 380

Rep: Reputation: 30
you need to add a directory as an argument to cp

su -c "mkdir -p /usr/share/NOTEPAD-EDITOR-1.01/NotepadIcons && cp *.gif /path/to/someplace/"
 
Old 12-02-2003, 09:49 PM   #4
Gerardoj
Member
 
Registered: May 2003
Location: Somewhere over the Rainbow
Distribution: Slackware 9.x, Knoppix, Damn Small Linux, RedHat.
Posts: 465

Original Poster
Rep: Reputation: 30
I changed it for

Code:
 su -c "mkdir -p /usr/share/NOTEPAD-EDITOR-1.01/NotepadIcons && cp -r *.gif /usr/share/NOTEPAD-EDITOR-1.01/NotepadIcons/"
and cp: cannot stat `*.gif': No such file or directory appears me. now what could be the problem?

Thanks

Last edited by Gerardoj; 12-02-2003 at 09:51 PM.
 
Old 12-02-2003, 09:53 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,005
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
As you su -c
the current dir changes.

you'll need to mkdir && cd <where gifs are> && cp



Cheers,
Tink
 
Old 12-02-2003, 09:56 PM   #6
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Quote:
The problem is that you don't
cd into the directory, and that
cp doesn't have a target.
I agree with Tinkster cause you make the directory, then jump to the cp command without getting into the directory which has the gif files. You also don't say where to copy things to.
 
Old 12-02-2003, 10:21 PM   #7
Gerardoj
Member
 
Registered: May 2003
Location: Somewhere over the Rainbow
Distribution: Slackware 9.x, Knoppix, Damn Small Linux, RedHat.
Posts: 465

Original Poster
Rep: Reputation: 30
Thanks for Your Reply, I changed it and now is working fine.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
trouble with quotation marks in c-shell script mathias1979 Programming 3 06-01-2005 09:49 AM
trouble with quotation marks in c-shell script mathias1979 Linux - Newbie 1 05-30-2005 11:16 AM
Trouble with a shell script running with inetd scottd431 Linux - Networking 0 11-11-2004 10:57 AM
Trouble with a shell script running with inetd scottd431 Linux - General 0 11-11-2004 10:05 AM
Trouble when automating ftp with shell script hari_s_82 Linux - Newbie 2 09-23-2004 03:17 AM


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

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration