Sponsored Content
Top Forums Shell Programming and Scripting Trying to modified files using sed command Post 302481424 by juanchy on Friday 17th of December 2010 12:29:58 PM
Old 12-17-2010
Trying to modified files using sed command

hi all,

i will like to modified some files with the extension .gjf . All this files have in first line this #P PM3 Opt and i want to change that to this :
Code:
 %nproc=2    
 %chk=filename.chk 
 #p B3LYP /6-31G** opt

in order to do that i have try to do a script with the sed command but i really don't know how to insert %nproc=2 in line N°1, %chk=filename.chk in line N°2 and #p B3LYP /6-31G** opt in line N°3 . The script that i have wrote is
Code:
 for x in $(ls *.gjf);  
   do n=$(echo $x | cut -d. -f1);
  echo " sed -i 's/#P PM3 Opt/nproc=2 %chk=$n.chk #p B3LYP \/6-31G** opt/g' $n.gjf" 
 
 done

but this change the text #P PM3 Opt by nproc=2 %chk=$n.chk #p B3LYP / 6-31G** opt all this text in the first line.

i will be very grateful if some one of the forum can help me in solve this problem.

thank you very much .

Last edited by Scott; 12-17-2010 at 02:10 PM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

chmod command for recently modified files

hello! is there a way for me to use the chmod command to change permissions for several files all at once -based on the fact that these files were all most recently modified TODAY ? I can't use a wildcard on their filenames because the filenames are varied. But I was hoping I could somehow do... (2 Replies)
Discussion started by: polka_friend
2 Replies

2. UNIX for Dummies Questions & Answers

how to retrieve original contents of a modified file (modified using vi)

Made changes to a file using vi editor and saved those changes now realised that the changes are not required How can I get the previous version of the file.i.e the one which was there on which I had made changes (3 Replies)
Discussion started by: novice100
3 Replies

3. UNIX for Dummies Questions & Answers

Help - Find command with list of files modified descending Order

Hi, I would like to know the command to get the files order in descending order with "FIND" command. Appreciate your help Thanks (4 Replies)
Discussion started by: TonySolarisAdmi
4 Replies

4. Shell Programming and Scripting

command to know files modified morethan 30 min

Hi, i use ksh and want to know the command for gettting the files which were not modified in last 30 min. find . -name <filename > -mtime 0.0209 is not giving the results. Thanks , Mohan (3 Replies)
Discussion started by: mohanpadamata
3 Replies

5. UNIX for Advanced & Expert Users

command for recently modified files - "find" command not working

I have three files a.txt , b.txt , c.txt in a directory called my_dir1 .These files were created before two or three months . I have a tar file called my_tar1.tar which contains three files a.txt , b.txt , d.txt . Somebody untarred the my_tar1.tar into my_dir1 directory. So existing two files were... (1 Reply)
Discussion started by: joe.mani
1 Replies

6. Shell Programming and Scripting

command to know last modified user of a file

Hi I have below requirement. There are set of files to be monitored for audit purpose. Source file contains the file name and its location on server. Need to have shell script which generate a output file which is having the details of above files ( last modified user name ,lat update... (12 Replies)
Discussion started by: karnatis
12 Replies

7. UNIX for Dummies Questions & Answers

Finding the modified timestamp of files from the piped output of du command

Version Info +++++++++++++++ RHEL 5.4 Since ls command lists file sizes in Bytes which can be long I use du command like below. I have run the du command for the below files as shown below. But I want pipe this output to ls command just to see the modified timestamp for these files. ... (7 Replies)
Discussion started by: kraljic
7 Replies

8. UNIX for Dummies Questions & Answers

Find command to get the modified files past 2 hours

Hello, How to get the modified/created files past 2 hours in Solaris with find command? Thank you. (7 Replies)
Discussion started by: balareddy
7 Replies

9. UNIX for Dummies Questions & Answers

Copy files from one drive to another, keeping most recently modified files

Hi all, I am a bit of a beginner with shell scripting.. What I want to do is merge two drives, for example moving all data from X to Y. If a file in X doesn't exist in Y, it will be moved there. If a file in X also exists in Y, the most recently modified file will be moved to (or kept) in... (5 Replies)
Discussion started by: apocolapse
5 Replies

10. UNIX for Dummies Questions & Answers

Du command and modified date in ssh

Hello, I am a new user to linux and having trouble completing this task. I want to list a directory of files and folders including the name, human readable size, and last modified date. So far I can get two of the three but not all together. For example: Using ls -lh gives me drwxr-xr-x... (7 Replies)
Discussion started by: Newuzer
7 Replies
MUMMY(1)							   User Commands							  MUMMY(1)

NAME
mummy - generate C# wrappers from C++ code. SYNOPSIS
mummy [options] files... DESCRIPTION
mummy is a command line executable that generates C# wrappers from gccxml output. A C# class is generated to wrap the wrappable class named in the gccxml output. Settings to control the wrapping are given inline directly in the class header file or in the MummySettings.xml input file. mummy version 1.0.2 (revision 599) Command line options: --csharp-file opt C# output file. Default value is 'ClassName.cs' in the current directory. --csharp-unit-test-file opt C# output file. Default value is 'ClassNameUnitTest.cs' in the current directory. --export-layer-file opt C++ output file. Default value is 'ClassNameEL.cxx' in the current directory. --gccxml-file opt Input file (output of gccxml) describing class to be wrapped. Required. --help Display (this) detailed help information. --settings-file opt Input file describing mummy configuration settings, including the set of wrapped classes. Required. --suppress-warnings opt opt ... Space separated list of warning numbers to suppress. --verbose Overwhelm me with output, I don't have enough reading material... ;) --version Display the program version. AUTHORS
This manual page was written by Mathieu Malaterre <malat@debian.org>, for the Debian project (and may be used by others). SEE ALSO
cableidx(1), gccxml(1). mummy version 1.0.2 (revision 599) December 2011 MUMMY(1)
All times are GMT -4. The time now is 09:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy