Sponsored Content
Full Discussion: Output file content
Top Forums UNIX for Advanced & Expert Users Output file content Post 302589883 by tushar_spatil on Friday 13th of January 2012 01:51:54 AM
Old 01-13-2012
thanks for reply curleb

I have copy.sh script and content of script is as follows

PHP Code:
cd /sasdata/script
sh 
.TR_CNTO328.sh 2>&tee -a TR_CNTO328.log
wait
sh 
.CNT06785.sh 2>&tee -a CNT06785.log
wait
sh 
.CNT0328.sh 2>&tee -a CNTO328.log
wait
sh 
.CNT01275.sh 2>&tee -a CNT01275.log
wait
sh 
.CNT0148.sh 2>&tee -a CNT0148.log
wait
exit 
and content of TR_CNTO328.sh script. this script transfer data to another server and i need the output of this script to say TR_CNTO328.log file

PHP Code:
STAMP=$(perl -'($ss, $mm, $hh, $DD, $MM, $YY) = localtime(time() - 12096000);
printf "%04d%02d%02d%02d%02d", $YY + 1900, $MM + 1, $DD, $hh, $mm'
)
touch $STAMP /sasdata/CNTO1275/C0743T23/Final_DBL/Analysis
cd 
/sasdata/CNTO1275/C0743T23/Final_DBL/Analysis 
find 
. -type f -newer . -exec scp -{} sasadmin@cua35132sas101:/sasdata/CNTO1275/C0743T23/Final_DBL/Analysis ';' ;
STAMP=$(perl -'($ss, $mm, $hh, $DD, $MM, $YY) = localtime(time() - 86400);
printf "%04d%02d%02d%02d%02d", $YY + 1900, $MM + 1, $DD, $hh, $mm'
)
touch $STAMP /sasdata/CNTO1275/C0743T23/Final_DBL/Data
cd 
/sasdata/CNTO1275/C0743T23/Final_DBL/Data  
find 
. -type f -newer . -exec scp -{} sasadmin@cua35132sas101:/sasdata/CNTO1275/C0743T23/Final_DBL/Data ';' ;
STAMP=$(perl -'($ss, $mm, $hh, $DD, $MM, $YY) = localtime(time() - 86400);
printf "%04d%02d%02d%02d%02d", $YY + 1900, $MM + 1, $DD, $hh, $mm'
)
touch $STAMP /sasdata/CNTO1275/C0743T23/Final_DBL/Docs
cd 
/sasdata/CNTO1275/C0743T23/Final_DBL/Docs
find 
. -type f -newer . -exec scp -{} sasadmin@cua35132sas101:/sasdata/CNTO1275/C0743T23/Final_DBL/Docs ';' 
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

file content to standard output from a script

hi folks how do i output contents of file in standard output. in my script, i say x=`cat filename' echo $x below is the actual file *********** asda afdf fdf sdf dsfsdfsd fds dsfdfsdfsdg ssgd sgdg sdfsdgfsdg dgfd gsfd gs sdg sfdg s in my script, i am trying to output the... (4 Replies)
Discussion started by: bryan
4 Replies

2. Shell Programming and Scripting

Dynamic output file generation using a input text file with predefined output format

Hi, I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format. Example: File.txt AP|{SSHA}VEEg42CNCghUnGhCVg== APVG3|{SSHA}XK|"password" AP3|{SSHA}XK|"This is test" .... etc --------- test.sh has... (1 Reply)
Discussion started by: hudson03051nh
1 Replies

3. Shell Programming and Scripting

How to read file and only output certain content

Hi - I have a file containing data like :- cn=tommy,cn=users,c=uk passwordexpirydate=20100530130623z cn=jane,cn=users,c=uk passwordexpirydate=20100423140734z cn=michael,cn=users,c=uk passwordexpirydate=20100331020044z I want to end up with a file that looks like:-... (6 Replies)
Discussion started by: sniper57
6 Replies

4. AIX

Unable to get the full content into a file when I redirect installp command output..

When i use the command to check the preview of the filesets to be installed using CLI # When using this commad 'm able to see all Preview view of the filesets to be installed installp -apgX -d "." all # When I redirected the same output to a file 'm able to see only half the details... (1 Reply)
Discussion started by: Sounddappan
1 Replies

5. Shell Programming and Scripting

Sed: replace content from file with the content from file

Hi, I am having trouble while using 'sed' with reading files. Please help. I have 3 files. File A, file B and file C. I want to find content of file B in file A and replace it by content in file C. Thanks a lot!! Here is a sample of my question. e.g. (file A: a.txt; file B: b.txt; file... (3 Replies)
Discussion started by: dirkaulo
3 Replies

6. Shell Programming and Scripting

Change the file name and copy old file content to new file names.

Hi, I have a files in a directory as below :- ls -1 mqdepth-S1STC02 proc-mq-S1STC01 proc-mq-S1STC02 proc-mq-S1STC03 Whereever i have S1STC i need to copy them into new file with file name S2STC. expected output :- ls -1 mqdepth-S2STC02 proc-mq-S2STC01 proc-mq-S2STC02... (3 Replies)
Discussion started by: satishmallidi
3 Replies

7. Shell Programming and Scripting

How to remove exisiting file content from a file and have to append new file content?

hi all, i had the below script x=`cat input.txt |wc -1` awk 'NR>1 && NR<'$x' ' input.txt > output.txt by using above script i am able to remove the head and tail part from the input file and able to append the output to the output.txt but if i run it for second time the output is... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies

8. UNIX for Dummies Questions & Answers

Find all files containing string not following symlinks CAT (modified) output content to /filename

This should recursively walk through all dirictories and search for a specified string in all present files, if found output manicured content (eg some regex) with CAT into a specified directory (eg /tmp/) one by one, keeping the original names This is what I have so far, which seems to... (1 Reply)
Discussion started by: lowmaster
1 Replies

9. Shell Programming and Scripting

Insert content of a file to another file at a line number which is given by third file

Hi friends, here is my problem. I have three files like this.. cat file1.txt ======= unix is best unix is best linux is best unix is best linux is best linux is best unix is best unix is best cat file2.txt ======== Windows performs better Mac OS performs better Windows... (4 Replies)
Discussion started by: Jagadeesh Kumar
4 Replies
All times are GMT -4. The time now is 09:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy