Sponsored Content
Full Discussion: issue in naming a file
Top Forums Shell Programming and Scripting issue in naming a file Post 302344662 by mac4rfree on Monday 17th of August 2009 09:06:10 AM
Old 08-17-2009
try this.. its working for me...

cat abc > "abc(+1)"


10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

naming a file to hostname

I am running a script remotely to another client. after it runs it places the file in /tmp. I need the file in /tmp to be renamed to the local hostname. but when i set the variable it names the file to my local hostname. how do i fix that (4 Replies)
Discussion started by: deaconf19
4 Replies

2. Shell Programming and Scripting

#file naming

hi all, Please advise at what circumstance those file will become -rwxr-xr-x 1 psa psa 1969088 Aug 18 2006 #libaa.sl -rwx------ 1 psa psa 2166784 Jul 25 2006 #libcrypto.sl.0.9.7 -rwx------ 1 psa psa 904040 Jul 25 2006 #libxxx.sl -rwx------ 1 psa ... (2 Replies)
Discussion started by: rauphelhunter
2 Replies

3. Shell Programming and Scripting

file naming question

Hi, I need some help! I have a file in which i im splitting into 20 different files each called model_001.in model_002.in etc... i would like to make directory for each file using only the name and not the extension so that the directory names are model_001 model_002 etc. ... (8 Replies)
Discussion started by: olifu02
8 Replies

4. Shell Programming and Scripting

File splitting, naming file according to internal field

Hi All, I have a rather stange set of requirements that I'm hoping someone here could help me with. We receive a file that is actually a concatenation of 4 files (don't believe this would change, but ideally the solution would handle n files). The super-file looks like:... (7 Replies)
Discussion started by: Leedor
7 Replies

5. Shell Programming and Scripting

File naming format

Hi, su - oracle<<EOC export PATH=${PATH}:${ORACLE_HOME}/bin exit EOC set `sqlplus -S $user_name/$password@$tns<<EOS set head off select min(time),max(time) from products; exit; EOS` var1=$1 var2=$2 su - oracle -c "exp user/pass@localdb... (7 Replies)
Discussion started by: milink
7 Replies

6. SuSE

Network card naming issue

I have a Sun server running SuSE with 2 network cards, the cards naming is eth0-to-eth3 for the first card, and eth4-eth7 for the second one, I've replace the second card and I got naming issue: I got eth4, eth5, eth7, eth8 I mean the system doesn't see eth6 so it took eth7 instead, is there a way... (4 Replies)
Discussion started by: scorpionzoe
4 Replies

7. Red Hat

File System Naming Convention

Hi, I am installing a new RHEL 5 application server containing JBOSS along with other specific 3rd party applications. I know that this usually gets installed in /opt but I was thinking of installing these on a new separtate lv / file system instead. i.e. /<my_new_FS_name> rather than... (6 Replies)
Discussion started by: Duffs22
6 Replies

8. Shell Programming and Scripting

file naming in a script

#!/bin/bash while read inputline do what="$inputline" echo $what; if ; then exit fi $reextend $what $print ls -a done this is my code i am trying to change all of the file types of a certain directory to another file type but im not all the way there can someone help please (3 Replies)
Discussion started by: domdom110
3 Replies

9. UNIX for Dummies Questions & Answers

Naming file with special characters ?

Hi all, I have a problem with file naming in linux. I have to create a file named like 11/22.csv but shell displays error: no such file or dir. Problem is / character in the file name. I searched unix linux naming concepts and it's restricted in OS. Please tell me if there's any other chance? OS... (3 Replies)
Discussion started by: sembii
3 Replies

10. Shell Programming and Scripting

Help with naming the file

Hi, I have a folder that contains files abc.txt def.txt ....and so on Inside abc.txt, I have @<TRIPOS>MOLECULE 4|Chelerythrine|abcb11_earlyIdentification_Stronginhib_washed_ligprep|sdf|1|dock Inside def.txt, I have @<TRIPOS>MOLECULE... (6 Replies)
Discussion started by: rossi
6 Replies
subst(1T)						       Tcl Built-In Commands							 subst(1T)


subst - Perform backslash, command, and variable substitutions SYNOPSIS
subst ?-nobackslashes? ?-nocommands? ?-novariables? string _________________________________________________________________ DESCRIPTION
This command performs variable substitutions, command substitutions, and backslash substitutions on its string argument and returns the fully-substituted result. The substitutions are performed in exactly the same way as for Tcl commands. As a result, the string argument is actually substituted twice, once by the Tcl parser in the usual fashion for Tcl commands, and again by the subst command. If any of the -nobackslashes, -nocommands, or -novariables are specified, then the corresponding substitutions are not performed. For example, if -nocommands is specified, command substitution is not performed: open and close brackets are treated as ordinary characters with no special interpretation. Note that the substitution of one kind can include substitution of other kinds. For example, even when the -novariables option is speci- | fied, command substitution is performed without restriction. This means that any variable substitution necessary to complete the command | substitution will still take place. Likewise, any command substitution necessary to complete a variable substitution will take place, even | when -nocommands is specified. See the EXAMPLES below. | If an error occurs during substitution, then subst will return that error. If a break exception occurs during command or variable substi- | tution, the result of the whole substitution will be the string (as substituted) up to the start of the substitution that raised the excep- | tion. If a continue exception occurs during the evaluation of a command or variable substitution, an empty string will be substituted for | that entire command or variable substitution (as long as it is well-formed Tcl.) If a return exception occurs, or any other return code is | returned during command or variable substitution, then the returned value is substituted for that substitution. See the EXAMPLES below. | In this way, all exceptional return codes are ``caught'' by subst. The subst command itself will either return an error, or will complete | successfully. EXAMPLES
When it performs its substitutions, subst does not give any special treatment to double quotes or curly braces (except within command sub- stitutions) so the script set a 44 subst {xyz {$a}} returns ``xyz {44}'', not ``xyz {$a}'' and the script | set a "p} q {r" | subst {xyz {$a}} | return ``xyz {p} q {r}'', not ``xyz {p} q {r}''. | When command substitution is performed, it includes any variable substitution necessary to evaluate the script. | set a 44 | subst -novariables {$a [format $a]} | returns ``$a 44'', not ``$a $a''. Similarly, when variable substitution is performed, it includes any command substitution necessary to | retrieve the value of the variable. | proc b {} {return c} | array set a {c c [b] tricky} | subst -nocommands {[b] $a([b])} | returns ``[b] c'', not ``[b] tricky''. | The continue and break exceptions allow command substitutions to prevent substitution of the rest of the command substitution and the rest | of string respectively, giving script authors more options when processing text using subst. For example, the script | subst {abc,[break],def} | returns ``abc,'', not ``abc,,def'' and the script | subst {abc,[continue;expr 1+2],def} | returns ``abc,,def'', not ``abc,3,def''. | Other exceptional return codes substitute the returned value | subst {abc,[return foo;expr 1+2],def} | returns ``abc,foo,def'', not ``abc,3,def'' and | subst {abc,[return -code 10 foo;expr 1+2],def} | also returns ``abc,foo,def'', not ``abc,3,def''. SEE ALSO
Tcl(1T), eval(1T), break(1T), continue(1T) KEYWORDS
backslash substitution, command substitution, variable substitution ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWTcl | +--------------------+-----------------+ |Interface Stability | Uncommitted | +--------------------+-----------------+ NOTES
Source for Tcl is available on http://opensolaris.org. Tcl 7.4 subst(1T)

Featured Tech Videos

All times are GMT -4. The time now is 06:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy