Getting current folder name appended to all desired files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Getting current folder name appended to all desired files
# 8  
Old 04-17-2011
Code:
...
mv $file $newfile >/dev/null 2>&1
...

regards,
Ahamed
This User Gave Thanks to ahamed101 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

UNIX script to replace old date with current date dynamically in multiple files present in a folder

I am trying to work on a script where it is a *(star) delimited file has a multiple lines starts with RTG and 3rd column=TD8 I want to substring the date part and I want to replace with currentdate minus 15 days. Here is an example. iam using AIX server $ cat temp.txt RTG*888*TD8*20180201~... (1 Reply)
Discussion started by: Shankar455
1 Replies

2. Shell Programming and Scripting

Folder contents getting appended as strings while redirecting file contents to a variable

Hi one of the output of the command is as below # sed -n "/CCM-ResourceHealthCheck:/,/---------/{/CCM-ResourceHealthCheck:/d;/---------/d;p;}" Automation.OutputZ$zoneCounter | sed 's/$/<br>/' Resource List : <br> *************************** 1. row ***************************<br> ... (2 Replies)
Discussion started by: vivek d r
2 Replies

3. UNIX for Dummies Questions & Answers

Move txt file to with current date appended to filename

I have multiple txt files which begin with the word "orders" in folder C:\source. I need to move the files to folder C:\dest and rename them to "process_<date>_<count>" So for example , if there are 3 files ordersa.txt , ordersb.txt and ordersc.txt in C:\source , after running the script I want... (7 Replies)
Discussion started by: johannd
7 Replies

4. Shell Programming and Scripting

Move txt file to with current date appended to filename

I have multiple txt files which begin with the word "orders" in folder C:\source. I need to move the files to folder C:\dest and rename them to "process_<date>_<count>" So for example , if there are 3 files ordersa.txt , ordersb.txt and ordersc.txt in C:\source , after running the script I want... (1 Reply)
Discussion started by: johannd
1 Replies

5. Shell Programming and Scripting

Convert all files in current folder from UTF8 to ANSI, name unchanged.

Asking for a Linux command line to convert all files in current folder from UTF8 to ANSI, name unchanged. Best Regards Pei (3 Replies)
Discussion started by: jiapei100
3 Replies

6. UNIX for Dummies Questions & Answers

tar file from current folder

Hello guys, I am sure this has been asked before, but honestly, I cant find post talking about it. Here is what I need: - A tar file will be generated manually by user - This tar file is then used within a bash shell script My source folder structure is like this: ... (2 Replies)
Discussion started by: manolain
2 Replies

7. Shell Programming and Scripting

How to find files in current folder only?

How do I find files in current folder only? We are on AIX 5.3, so maxdepth is not supported. I tried to do this find /dir1/dir2/dir3/dir4 -prune -type f to display all files in /dir1/dir2/dir3/dir4 only but it does not show any files. Somehow the -prune option works for dir3 level... (7 Replies)
Discussion started by: Hangman2
7 Replies

8. UNIX for Dummies Questions & Answers

How to copy set of files with date appended to their name

Hi gurus, I have set of files in a directory ex : test_file1.csv test_file2.csv test_file3.csv my requirement is to copy these files into another directory but with date appended to the name : like after copying the files should look like : test_file1_07072008.csv ... (7 Replies)
Discussion started by: sish78
7 Replies

9. Shell Programming and Scripting

Use awk to create new folder in current directory

Alright, I am sure this is a laughable question, but I don't know so I am going to ask anyway. I have a little script I am writing to take information from one source, recode it in a certain way, and print to files for each subject I have data for. This all works perfectly. I just want to put... (6 Replies)
Discussion started by: ccox85
6 Replies

10. UNIX for Dummies Questions & Answers

Pack current folder

How do I pack (using tar zcvf ?) the current folder inluding all files and folders ?? I need to be sure to get all files and folders/subfolders... Later I will unpack into a new folder on a new server.. Appreciate any help.. (3 Replies)
Discussion started by: WebWatch
3 Replies
Login or Register to Ask a Question
xpamethod(7)							SAORD Documentation						      xpamethod(7)

NAME
XPAMethod - XPA Communication Methods SYNOPSIS
XPA supports both inet and unix (local) socket communication. DESCRIPTION
XPA uses sockets for communication between processes. It supports three methods of socket communication: inet, localhost, and unix. In gen- eral, the same method should be employed for all XPA processes in a session and the global environment variable XPA_METHOD should be used to set up the desired method. By default, the preferred method is "inet", which is appropriate for most users. You can set up a different method by typing something like: setenv XPA_METHOD local # unix csh XPA_METHOD=local; export XPA_METHOD # unix sh, bash, windows/cygwin set XPA_METHOD=localhost # dos/windows The options for XPA_METHOD are: inet, unix (or local), and localhost. On Unix machines, this environment setup command can be placed in your shell init file (.cshrc, .profile, .bashrc, etc.) On Windows platforms, it can be placed in your AUTOEXEC.BAT file (I think!). By default, inet sockets are used by XPA. These are the standard Internet sockets that are used by programs such as Netscape, ftp. etc. Inet sockets utilize the IP address of the given machine and a (usually random) port number to communicate between processes on the same machine or between different machines on the Internet. (Note that XPA has an Access Control mechanism to prevent unauthorized access of XPA access points by other computers on the Net). For users connected to the Internet, this usually is the appropriate communication method. For more information about setting up XPA communication between machines, see Communication Between Machines. In you are using XPA on a machine without an Internet connection, then inet sockets are not appropriate. In fact, an XPA process often will hang for many seconds while waiting for a response from the Domain Name Service (DNS) when using inet sockets. Instead of inet sockets, users on Unix platforms can also use unix sockets (also known as local sockets). These sockets are based on the local file system and do not make use of the DNS. They generally are considered to be faster than inet sockets, but they are not implemented under Windows. Use local sockets as a first resort if you are on a Unix machine that is not connected to the Internet. Users not connected to the Internet also can use localhost sockets. These are also inet-type sockets but the IP address used for the local machine is the localhost address, 0x7F000001, instead of the real IP of the machine. Depending on how sockets are set up for a given plat- form, communication with the DNS usually is not required in this case (though of course, XPA cannot interact with other machines). The localhost method will generally work on both Unix and Windows platforms, but whether the DNS is required or not is subject to individual configurations. A final warning/reminder: if your XPA-enabled server hangs at startup time and your XPA_METHOD is inet, the problem probably is related to an incorrect Internet configuration. This can be confirmed by using the unix method or (usually) the localhost method. You can use these alternate methods if other hosts do not need access to the XPA server. SEE ALSO
See xpa(7) for a list of XPA help pages version 2.1.14 June 7, 2012 xpamethod(7)