10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Good day all.
I'm trying to rename some files in my home directory with some bizarre results. Basically I need to change the IP address in the filename to the hostname which I ggrep from within the file:
-rw-r--r-- 1 bh694n nrc 5095 May 2 20:03 alarms_999.189.161.146.log... (2 Replies)
Discussion started by: BRH
2 Replies
2. Shell Programming and Scripting
hi All, Any one answer my requirement.
I have source location
src_dir="/home/oracle/arun/IRMS-CM"
My Target location
dest_dir="/home/oracle/arun/LiveLink/IRMS-CM/$dc/$pc/$ct"
my source text files check with below example.text file content
$fn "\t" $dc "\t" $pc "\t" ... (3 Replies)
Discussion started by: sravanreddy
3 Replies
3. Shell Programming and Scripting
Hi,
In sftp script to get files, I have to rename all the files which I am picking. Rename command does not work here. Is there any way to do this?
I am using #!/bin/ksh
For eg: sftp user@host <<EOF
cd /path
get *.txt
rename *.txt *.txt.done
... (7 Replies)
Discussion started by: jhilmil
7 Replies
4. Shell Programming and Scripting
Hi Friends,
I wrote one shell script to check the record count in two files and that will send us the notification activity if found zero record count.
What i did is I created for loop and checking the count for both of the files but what is happening is for first file has data then it's... (13 Replies)
Discussion started by: victory
13 Replies
5. UNIX for Advanced & Expert Users
I have about 1000 files containing the character * in the name. I need to find these files and replace the * with a -. I am working with HP UX v11. I am using the following command
find . -type f -name '*\**' -exec bash -c 'f="$1"; mv "$f" "${f//\*/-}"' - '{}' \
People tell me it works for... (4 Replies)
Discussion started by: MikeDavid
4 Replies
6. Shell Programming and Scripting
Hi, I have the following problem:
I have a list of files:
1.txt
2.txt
3.txt
4.txt
Then I have a list of variable names inside variable.txt:
A
B
C
D
I'd like to rename 1.txt, 2.txt etc using the variables from variable.txt (2 Replies)
Discussion started by: hubleo
2 Replies
7. Shell Programming and Scripting
hi ,
I have certain files at the same path with differeent extensions like .dat , .txt etc ...........i need to rename them with extension .found at the same path with the help of loop....
also the files names will be like this ;
abc_2010_c1.dat
abc_2010_c2.dat
xyz_2010_c1.txt (2 Replies)
Discussion started by: amitpta
2 Replies
8. UNIX for Advanced & Expert Users
Hi,
I need to rename all the .txt files present in current directory to .dat files respectively in UNIX.
for example:
$ ls
aaa.txt bbb.txt ccc.txt
I need to change them to
$ ls
aaa.dat bbb.dat ccc.dat
Is there any UNIX command to do this in one go?
... (3 Replies)
Discussion started by: Johny001
3 Replies
9. Shell Programming and Scripting
Hi ,
I have a source file having structure as below
aaaaaa cvvvvvv
bbbbbb ddddddd
wwww cccccds
I want to create a new file in which each line contains two pipe separated characters eg first character till end of first space and then next 2 characters from same file
eq... (5 Replies)
Discussion started by: ashish2345
5 Replies
10. UNIX for Dummies Questions & Answers
Hello,
I have a bunch of files whose names start with 'xx'
The first line of each file looks something like:
a|...|...|...|... , ...
In order to rename all of these files to whatever's between the 4th | and the comma (in the first line of that particular file) , I have been using:
for... (2 Replies)
Discussion started by: juliette salexa
2 Replies