Sponsored Content
Top Forums Shell Programming and Scripting Need some Help for file filteration and saving the output in other directory Post 302601038 by agama on Wednesday 22nd of February 2012 06:09:50 PM
Old 02-22-2012
I don't see any problems with your script. You probably should change the double redirection (>>) to a signle (>), but that's not causing the files to be empty.

The only thing I can think of is that you might have trailing blanks and/or tabs in your list of patterns (the filter file: /home/dstst/ekta/xp). Check it to be sure that there isn't any leading or trailing white space (spaces or tabs) as that might be the cause of nothing being found.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Saving output from awk into a perl variable

How would I pass awk output to a perl variable? For example, I want to save the value in the 4th column into the variable called test. My best guess is something as follow, but I am sure this isn't correct. $test = system("awk '/NUMBER/{print \$4}' $_"); (8 Replies)
Discussion started by: userix
8 Replies

2. UNIX for Dummies Questions & Answers

saving command output to a variable

Hello, I have a shell script containing a command string in the following format: command1 | command2 | cut -c9-16 The output from this is a record number (using characters 9-16 of the original output string) e.g. ORD-1234 I wish to save this value to a variable for use in later commands... (4 Replies)
Discussion started by: philjo
4 Replies

3. UNIX for Dummies Questions & Answers

Saving a temporary output within a script

Good morning everyone, i am looking to know how to save the output of a command and reuse it again within a script i already tired this one but it didn't work TEMPDIR=/dir1/dir2 My_command> $TEMPDIR/$TEMPFILE rm $TEMPDIR/$TEMPFILE* it keeps saying "cannot write to a... (15 Replies)
Discussion started by: Portabello
15 Replies

4. Shell Programming and Scripting

saving output from bash into a file

I am ssh to many servers to get some information... however sometimes the server is unreacheable and i am getting an error. I want to save that output to a file but I am not able to do so... I want to be able to save output of bash into a file.. so when I run this command on a script ssh... (5 Replies)
Discussion started by: eponcedeleonc
5 Replies

5. Shell Programming and Scripting

Need help for file filteration script......

Hiii all... Pls help me out wid below prblm : i have 5 files A,B,C,D and E located at /home/anubha I have a file F located at /home/anubha/ed File F has some records which can be matched in A,B,C,D and E and another set of files on the basis of these filteration should be created i.e.... (5 Replies)
Discussion started by: ektubbe
5 Replies

6. Shell Programming and Scripting

Need some Help for file filteration and saving the output in other directory using grep....plz ...

Hi all........ Plss do help me.......in a big trouble... :wall::wall::wall: I have 3 directories named as :1. /home/shuchi/source 2./home/shuchi/destination 3./home/shuchi/filter now the problem is /home/shuchi/source has say 2 files with extension .txt as given below : A.txt Code: ... (0 Replies)
Discussion started by: ektubbe
0 Replies

7. Shell Programming and Scripting

Saving svn log in a separate directory

Hi Folks, I have a directory at /usr/local/aa and there is other directory where I have checkout the code through svn checkout command ( /opt/app/fgh) now I can apply svn log command here as shown below $ cd /opt/app/fgh svn checkout <url> svn log shows me the log on console . please... (3 Replies)
Discussion started by: punpun66
3 Replies

8. Shell Programming and Scripting

Saving nohup output to a file other than nohup.out

Shell : bash OS : Oracle Linux 6.4 I want to save the ouput of a nohup command to file other than nohup.out . Below are my 3 attempts. For both Attempt1 and Attempt2 , the redirection logs the output correctly to the output file. But I get the error "ignoring input and redirecting stderr to... (7 Replies)
Discussion started by: kraljic
7 Replies

9. Shell Programming and Scripting

Saving files with file name as output

Hi, i need help with a file creation of an output program. I've got a program that with #find creates an output for each files in a directory. If i give this command : -o spec$(date -u +%Y%m%dt%H%M) it creates just one file, overwriting all the others since it is the creation date .... (2 Replies)
Discussion started by: Board27
2 Replies

10. Shell Programming and Scripting

sed command is saving output as blank file

Hi, I am working on a script where I am adding adding colors to few of the info in the output. Now , after that is done , I see colour codes in log files which I don't want to see.:mad::mad::mad::mad: So , I tried using sed command in script as below which gives me o/p (new.log) as blank file... (7 Replies)
Discussion started by: Dream4649
7 Replies
EXPAND(1)						    BSD General Commands Manual 						 EXPAND(1)

NAME
expand, unexpand -- expand tabs to spaces, and vice versa SYNOPSIS
expand [-t tab1,tab2,...,tabn] [file ...] unexpand [-a | -t tab1,tab2,...,tabn] [file ...] DESCRIPTION
The expand utility processes the named files or the standard input writing the standard output with tabs changed into blanks. Backspace characters are preserved into the output and decrement the column count for tab calculations. The expand utility is useful for pre-process- ing character files (before sorting, looking at specific columns, etc.) that contain tabs. The unexpand utility puts tabs back into the data from the standard input or the named files and writes the result on the standard output. The following options are available: -a (unexpand only.) By default, only leading blanks and tabs are reconverted to maximal strings of tabs. If the -a option is given, then tabs are inserted whenever they would compress the resultant file by replacing two or more characters. -t tab1,tab2,...,tabn Set tab stops at column positions tab1, tab2, ..., tabn. If only a single number is given, tab stops are set that number of column positions apart instead of the default number of 8. ENVIRONMENT
The LANG, LC_ALL and LC_CTYPE environment variables affect the execution of expand and unexpand as described in environ(7). EXIT STATUS
The expand and unexpand utilities exit 0 on success, and >0 if an error occurs. STANDARDS
The expand and unexpand utilities conform to IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY
The expand command appeared in 3.0BSD. BSD
October 13, 2006 BSD
All times are GMT -4. The time now is 10:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy