Sponsored Content
Top Forums Shell Programming and Scripting Converting file names to upper case Post 95367 by linuxpenguin on Tuesday 10th of January 2006 06:33:58 PM
Old 01-10-2006
for i in *
do
mv $i `echo $i|awk '{print toupper($0)}'`
done

now i dunno if you can consider this as a one line command, but i think it has to be, coz you cant execute each of the above line separately by itself to get your result
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

variables use upper case? sed : output to the same file?

Hi, Q1: are the variables in shell script usually UPPER CASE? Q2: can sed output to the same file that it's using it? eg. cat sameFile | sed 's/here/there/g' > sameFile ? I expect the sed replace all "here" to "there" and change it in sameFile. i tried that one, the sameFile... (1 Reply)
Discussion started by: gusla
1 Replies

2. UNIX for Dummies Questions & Answers

lower case to upper case string conversion in shell script

How can convert a Lower case variable value to an upper case in the kron shell script. (3 Replies)
Discussion started by: dchalavadi
3 Replies

3. UNIX for Dummies Questions & Answers

Perl - converting selected characters to upper/lower case

Using STDIN, how can I use perl to take an input string, with all lower case letters in the first five characters, and convert them to uppercase... then take all uppercase letters in the second five characters and convert them to lowercase. Example: MichaelSmith to michaELSMIth Thank you! (2 Replies)
Discussion started by: doubleminus
2 Replies

4. Shell Programming and Scripting

convert file names to upper case using tr command in Unix

Hi All, Need to convert file names to upper case using tr command in Unix. In a folder -> /apps/dd01/misc there are two files like: pi-abcd.pdf pi-efgh.pdf The output of should be like: pi-ABCD.pdf pi-EFGH.pdf I have used the command to work for a single file at a time... (3 Replies)
Discussion started by: a1_win
3 Replies

5. Shell Programming and Scripting

data array needs to change upper case to lower case

Hi all, i have a data array as followes. ARRAY=DFSG345GGG ARRAY=234FDFG090 ARRAY=VDFVGBGHH so on.......... i need all english letters to be change to lower case. So i am expecting to see ARRAY=dfsg345ggg ARRAY=234fdfg090 ARRAY=vdfvgbghh so on........ If i have to copy this data in... (8 Replies)
Discussion started by: usustarr
8 Replies

6. Shell Programming and Scripting

[Solved] Change Upper case to Lower case in C shell

Is there a command that can switch a character variable from UPPER case to lower case? like foreach AC ( ABC BCD PLL QIO) set ac `COMMAND($AC)` ... end Thanks a lot! (3 Replies)
Discussion started by: rockytodd
3 Replies

7. Shell Programming and Scripting

Conversion from Upper Case to Lower Case Condition based

Hello Unix Gurus : It would be really appreciative if can find a solution for this . I have records in a file . I need to Capitalize the records based on condition . For Example i tried the following Command COMMAND --> fgrep "2000YUYU" /export/home/oracle/TST/data.dat | tr '' ''... (12 Replies)
Discussion started by: tsbiju
12 Replies

8. Shell Programming and Scripting

converting to lower case or upper case

here is a code column_name="vivek" column_name2="ViVeK" column_name=$(echo $column_name | awk '{print tolower($0)}') column_name2=$(echo $column_name2 | awk '{print tolower($0)}') echo "column name 1 lower: $column_name" echo "column name... (6 Replies)
Discussion started by: vivek d r
6 Replies

9. Shell Programming and Scripting

convert specific field to upper case in file

Hi Friends, I have a file1.txt as below I want to convert the date fields in to upper case field3 and field 6 output.txt Plz help. (2 Replies)
Discussion started by: i150371485
2 Replies

10. Shell Programming and Scripting

Upper to lower case in encoded file

Hi All, I want to change the out put of a decode file from lower to upper. i used tr command but facing issue. set -vx id=$(id) dt=$(date) store=$1 if ]; then cd $APPL_TOP/local/bin cp .sqlpass.Z $$.temp.Z uncompress $$.temp.Z sed -e s/sqlpass/$$.sqlpass/ $$.temp >... (5 Replies)
Discussion started by: nag_sathi
5 Replies
rc(1M)																	    rc(1M)

NAME
rc - general purpose sequencer invoked upon entering new run level SYNOPSIS
DESCRIPTION
The shell script is the general sequencer invoked upon entering a new run level via the command (where N equals 0-6). The script is typi- cally invoked by the corresponding entry in the file as follows: is the startup and shutdown sequencer script. There is only one sequencer script and it handles all of the sequencer directories. This script sequences the scripts in the appropriate sequencer directories in alphabetical order as defined by the shell and invokes them as either startup or kill scripts. If a transition from a lower to a higher run level (i.e., init state) occurs, the start scripts for the new run level and all intermediate levels between the old and new level are executed. If a transition from a higher to a lower run level occurs, the kill scripts for the new run level and all intermediate levels between the old and new level are executed. If a start script link (e.g., in sequencer N has a stop action, the corresponding kill script should be placed in sequencer (e.g., Actions started in level N should be stopped in level This way, a system shutdown (e.g., transition from level 3 directly to level 0) will result in all subsystems being stopped. Start and Kill Scripts In many cases, a startup script will have both a start and a kill action. For example, the inetd script starts the Internet daemon in the start case, and kills that process in the stop case. Instead of two separate scripts, only one exists, which accepts both the and argu- ments and executes the correct code. In some cases, only a start action will be applicable. If this is the case, and if the action is specified, the script should produce a usage message and exit with an error. In general, scripts should look at their arguments and pro- duce error messages if bad arguments are present. When a script executes properly, it must exit with a return value of zero. If an error condition exists, the return value must be nonzero. Naming Conventions The startup and shutdown scripts (referred to as startup scripts hereafter) exist in the directory, named after the subsystem they control. For example, the script controls starting up the daemon. The contents of sequencer directories consist of symbolic links to startup scripts in These symbolic links must follow a strict naming convention, as noted in the various fields of this example: where the fields are defined as follows: The sequencer directory is numbered to reflect the run level for which its contents will be executed. In this case, start scripts in this directory will be executed upon entering run level 2 from run level 1, and kill scripts will be executed upon entering run level 2 from run level 3. The first character of a sequencer link name determines whether the script is executed as a start script (if the character is or as a kill script (if the character is A three digit number is used for sequencing scripts within the sequencer directory. Scripts are executed by type (start or kill) in alphabetical order as defined by the shell. Although it is not recommended, two scripts may share the same sequence number. The name of the startup script follows the sequence number. The startup script name must be the same name as the script to which this sequencer entry is linked. In this exam- ple, the link points to Note that short file name systems require file names of 14 or less characters. This means that the fourth field is limited to 10 or fewer characters. Scripts are executed in alphabetical order. The entire file name of the script is used for alphabetical ordering purposes. When ordering start and kill script links, note that subsystems started in any given order should be stopped in the reverse order to eliminate any dependencies between subsystems. This means that kill scripts will generally not have the same numbers as their start script counterparts. For example, if two subsystems must be started in a given order due to dependencies (e.g., followed by the kill counterparts to these scripts must be numbered so that the subsystems are stopped in the opposite order in which they were started (e.g., followed by Also keep in mind that kill scripts for a start script in directory will reside in For example, and might be start/kill counterparts. Arguments The startup/shutdown scripts should be able to recognize the following four arguments (where applicable): The argument is passed to scripts whose names start with Upon receiving the argument, the script should perform its start actions. The argument is passed to scripts whose names start with Upon receiving the argument, the script should perform its stop actions. The argument is passed to scripts whose names start with so that the script can report back a short message indicating what the start action will do. For instance, when the spooler script is invoked with a argument, it echoes This string is used by the startup routines. Scripts given just the argument will only print a message and not per- form any actions. The argument is passed to scripts whose names start with so that the script can report back a short message indicating what the stop action will do. For instance, when the spooler script is invoked with a argument, it echoes This string is used by the shutdown checklist. Scripts given just the argument will only print a message and not perform any actions. Script Output To ensure proper reporting of startup events, startup scripts are required to comply with the following guidelines for script output. o Status messages, such as must be directed to stdout. All error messages must be directed to stderr. o Script output, both stdout and stderr, is redirected to log file unless the startup checklist mode is set to the raw mode. In this case, all output goes to the console. All error messages should be echoed to stdout or stderr. o Startup scripts are not allowed to send messages directly to the console, or to start any daemons that immediately write to the console. This restriction exists because these scripts are now started by the checklist wrapper. All script output should go to either stdout or stderr, and thus be captured in a log file. Any console output will be garbled. o When a startup script returns an exit code of can display a specific message on the console prior to rebooting the system. This is achieved by creating a text file named containing the text to be displayed to the console. Note that deletes this file after displaying the message, so startup scripts need to write this file each time a specific message is required to be displayed on console prior to reboot. RETURN VALUE
The return values for startup scripts are as follows: Script exited without error. Script encountered errors. Script was skipped due to overriding control variables from files, or for other reasons, and did not actually do anything. Script will automatically reboot the system. Script exited without error and started a process in background mode. For return values greater than the action is same as return value script encountered errors. SEE ALSO
init(1M), shutdown(1M), inittab(4), rc.config(4). rc(1M)
All times are GMT -4. The time now is 08:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy