Results 1 to 2 of 2
Hello, i am new and idk if i am right category...
well, i want help in shell scripting in Fedora14
I want a script
"Find in curent folder for files, ...
- 05-18-2011 #1Just Joined!
- Join Date
- May 2011
- Posts
- 1
Fedora Shell Scripting
Hello, i am new and idk if i am right category...
well, i want help in shell scripting in Fedora14
I want a script
"Find in curent folder for files, and it copy first file he find with name gived by user, if name already exist then echo error message and finish"
command usage " bash scriptname copyASname"
smthing like
this is very simple script and dont work, $1 means SaveName $File means First file he find.Code:#!/bin/bash for files in /home/user/* do if [ -f $files ] then echo "Start copying..." cp $file $1 fi done
soz for my bad english ... :/
- 05-18-2011 #2
Sorry, I don't understand your requirement. For example If you have 3 files in /home/user named as "a.txt b.txt and c.txt" and want to save as "alpha.txt"
For your script will do this -
first cp a.txt alpha.txt
then
cp b.txt alpha.txt
finally
cp c.txt alpha.txt- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------


Reply With Quote