Sponsored Content
Top Forums Shell Programming and Scripting sed to rename files in bash loop Post 302994617 by cmccabe on Saturday 25th of March 2017 09:02:15 AM
Old 03-25-2017
Thank you very much for your help and explanations Smilie.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Hello - new here - bash script - need to rename and zip files.

I'm working on a project that basically unzips three zip files. When these unzip they create about 70+ directories with subdirectories of year/month with about 3 to 9 pdf files in each directory. Basically, I'm needing to figure out a way to zip these pdf files up. for instance the script... (1 Reply)
Discussion started by: Aixia
1 Replies

2. UNIX Desktop Questions & Answers

Rename files without using for loop

Hi, Is it possible to rename files at a time in a directory without using the for loop. (ex: intial filename- abc.txt to abc.tmp or abc.txt.tmp) I need to rename the files in a remote directory to which I'm connecting thru tectia sftp. The commands 'mv', 'for', 'echo' do not work. I have... (3 Replies)
Discussion started by: Qwerty123
3 Replies

3. UNIX for Dummies Questions & Answers

Rename files with sed in an until loop (double post)

I want to change the name of some of my files (mypics-0001, mypics-0002, mypics-0003.....mypics-0240) and I want to double check to see if this code is right: x=0 until do sed 's/mypics\-*/bday/g' done Would this change all of my file names to "bday0001....bday0240"? Please let me... (0 Replies)
Discussion started by: jvpike
0 Replies

4. Linux

rename files using loop with different name

Hi, i need to write a shell script where i have to loop through all the file in a directory and rename them based on below condition. file1.dat file2.dat file3.dat the above files has to be moved to another directory like below file1_201001.dat file2_201002.dat file3_201003.dat... (3 Replies)
Discussion started by: feroz
3 Replies

5. UNIX for Dummies Questions & Answers

For Loop To Rename Multiple Files Finds One Non-existant File

Okay so here's something that's confusing me: I have a script that's designed to remove the words "new_" from the front of any file except two exceptions and it looks something like this... for i in new_* do if ] && ]; then j=`echo "$i"|cut -c5-` mv $i $j fi done ... (5 Replies)
Discussion started by: Korn0474
5 Replies

6. UNIX for Dummies Questions & Answers

Split and Rename files using Terminal and bin/bash

I have a file named Me_thread_spell.txt that I want to split into smaller files. I want it to be split in each place there is a ;;;. For example, blah blah blah ;;; blah bhlah hlabl awasnceuir asenduhfoijhacseiodnbfxasd;;; oabwcuhaweoir;;; This full file would be three separate files... (7 Replies)
Discussion started by: mschpers
7 Replies

7. UNIX for Dummies Questions & Answers

Bash script to rename all files within a folder...

Hi. I don't have any experience with making scripts in bash. I need a simple script to rename all files in a folder to the format file1.avi, file2.avi, file3.avi, and so on..... Please note that the original files have different filenames and different extensions. But they all need to be... (2 Replies)
Discussion started by: dranzer
2 Replies

8. UNIX for Dummies Questions & Answers

Bash script to rename files in a directory

Dear friends, I have created a script to rename all files in a directory by appending the file name with username (who created the file), the date it was created. For example, "apple.doc" should be renamed to "johnFeb23apple.doc" where "john" is the owner and "Feb23" is file created date. It... (4 Replies)
Discussion started by: djsnifer
4 Replies

9. Shell Programming and Scripting

Loop through the dir and Rename zip files and their underlying text file.

I have files in the ABC_YYYYMMDD.zip format under a directory. Each zip file contains A text file in the ABC_YYYYMMDD.txt format. I am trying to create a script that will Rename the zip files and their underlying text file replacing the datepart in them with . For eg: in the case of... (1 Reply)
Discussion started by: bash987
1 Replies
ypset(1M)																 ypset(1M)

NAME
ypset - bind to particular Network Information Service server SYNOPSIS
host] domain] server Remarks The Network Information Service (NIS) was formerly known as Yellow Pages (YP). Although the name has changed, the functionality of the service remains the same. DESCRIPTION
tells to get Network Information Service (NIS) services for the specified domain from the process running on server (see ypserv(1M) and ypbind(1M)). server is the NIS server that the NIS client binds to, and is specified as either a host name or an IP address. If server is down or is not running this is not discovered until a local NIS client process tries to obtain a binding for the domain. The daemon then tests the binding set by If the binding cannot be made to the requested server, attempts to rebind to another server in the same domain present in the ypservers file. NOTE: In order to run must be initiated with the or options. For more information on how to initiate see ypbind(1M). The command is useful for binding a client node that is not on a broadcast network. If a client node exists on a broadcast network which has no NIS server running, and if there is a network with one running that is available via a gateway, can establish a binding through that gateway. It is also useful for debugging NIS client applications such as when a NIS map exists only at a single NIS server. In cases where several hosts on the local net are supplying NIS services, it is possible for to rebind to another host, even while you attempt to find out if the operation succeeded. For example, typing followed by and receiving the reply may be confusing. It could occur when host1 does not respond to because its process is not running or is overloaded, and host2, running gets the binding. The server is the NIS server to bind to, specified as either a host name or an IP address. Refer to ypfiles(4) and ypserv(1M) for an overview of the Network Information Service. Options recognizes the following options and command-line arguments: Bind server for the Version 2 NIS protocol. Set the binding on host instead of locally. host can be specified as a host name or an IP address. Use domain instead of the default domain returned by (see domainname(1)). DIAGNOSTICS
The user is not root, or ypbind was run without the flags. See ypserv(1M) for explanations of the flags. The user is not root, or ypbind was run without one of the flags. See ypserv(1M) for explanations of the flags. WARNINGS
Starting with ONCplus version B.11.31.02, the NIS Version 1 protocol is no longer available. AUTHOR
was developed by Sun Microsystems, Inc. SEE ALSO
domainname(1), ypwhich(1), ypserv(1M), ypfiles(4). ypset(1M)
All times are GMT -4. The time now is 09:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy