Sponsored Content
Operating Systems Solaris LS redirection to a file in same folder Post 302498673 by aravindan on Tuesday 22nd of February 2011 06:41:48 AM
Old 02-22-2011
Lightbulb LS redirection to a file in same folder

Hello,

I need an input from you all.
I want to redirect the output of 'ls' command to a file
but the file should not display the output file name in it.
scenario:
------------

$pwd
/home/user1
$ls
file1 file2
$ls > file3
$cat file3
file1 file2 file3

In this i dont wish the file3 to be part of the output.
I know if i do redirect to some other folder (ls > /tmp/file3) file3 will not be displayed. Smilie
But can the same be achieved by some option in ls by redirecting to a file in same folder. Smilie

Thanks in advance
Aravind
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File redirection

Is it possible to sh a command and receive the standard output on the scrren and use file redirection ie ls -lt > test. Also On SCO-UNIX there was a tellme command which displayed a message when a script had finished running is there something similar for HP UNIX as it is not working. (4 Replies)
Discussion started by: namtab
4 Replies

2. Shell Programming and Scripting

Parse the .txt file for folder name and FTP to the corrsponding folder.

Oracle procedure create files on UNIX folder on a regular basis. I need to FTP files onto windows server and place the files, based on their name, in the corresponding folders. File name is as follows: ccyymmddfoldernamefile.txt; Folder Name length could be of any size; however, the prefix and... (3 Replies)
Discussion started by: MeganP
3 Replies

3. Shell Programming and Scripting

file redirection problem

my querry is suppose i have duplicate std i/p with FD-3 --exec 0<&3 now redirected std i/p to a file ----exec 0<file1 suppose i am reading the file line by line --while read LINE cutting some fields and comparing it with a variable and if a match is found ... (0 Replies)
Discussion started by: mobydick
0 Replies

4. Shell Programming and Scripting

Move the file from one folder to another folder

Hi, I have a requirement to move a file from one folder(a) to another folder(b) only when folder (b) have a write permission. Folder permission is 755 If the permission is otherthan 755 we need to come out of the loop I will appreciate your help Thanks Soll (1 Reply)
Discussion started by: sollins
1 Replies

5. Shell Programming and Scripting

fbackup redirection to a file.

Hi, I have a fbackup step as below /bin/nice /etc/fbackup -f /dev/rmt/0m -i / -I /opt/monitrol/tmp/Index.full Now the errors that i will get in case of the fbackup step, I want to redirect them to a file. Please help me how to redirect to a file. Thanks, Avik. (5 Replies)
Discussion started by: avik.nandi
5 Replies

6. Shell Programming and Scripting

File redirection question

Hi all, I am working with the Grinder tool (unrelated to my question) to redirect the output of a program to a file as follows: java -cp $CLASSPATH net.grinder.TCPProxy > grinder.txt This is a proxy server which pipes output to a file. When I do something on my proxy, more and more goes to... (1 Reply)
Discussion started by: Annorax
1 Replies

7. UNIX for Dummies Questions & Answers

Output file redirection

Suppose I have a file named a When I write cat a>a The following error message is displayed cat: a: input file is output file and my file a is truncated to zero size. Also the exit status of the last command is 1 Can someone tell me what actually happens when I do so? (1 Reply)
Discussion started by: aagajaba
1 Replies

8. Shell Programming and Scripting

File Management: How do I move all JPGS in a folder structure to a single folder?

This is the file structure: DESKTOP/Root of Photo Folders/Folder1qweqwasdfsd/*jpg DESKTOP/Root of Photo Folders/Folder2asdasdasd/*jpg DESKTOP/Root of Photo Folders/Folder3asdadfhgasdf/*jpg DESKTOP/Root of Photo Folders/Folder4qwetwdfsdfg/*jpg DESKTOP/Root of Photo... (4 Replies)
Discussion started by: guptaxpn
4 Replies

9. Shell Programming and Scripting

want to move set of file from one folder to another folder

Hi all, let me explain my requirments i am having 5 folder with different name for eg) abc , cdf , efd, rtg, ead each 5 folders contain 15 files i want to move 10 files to some other folder, remain 5 files should be there in the same folder. give me some suggestion on this. (6 Replies)
Discussion started by: natraj005
6 Replies

10. Shell Programming and Scripting

Output redirection of c binary file to a file in shell script is failing

I am struck up with a problem and that is with output redirection. I used all the ways for the redirection of the output of c binary to a file, still it is failing. Here are the different ways which I have used: ./a.out | tee -a /root/tmp.txt 2>&1 ./a.out | tee -a /root/tmp.txt 1>&1 ./a.out |... (2 Replies)
Discussion started by: Maya29988
2 Replies
msh(1)							      General Commands Manual							    msh(1)

NAME
msh - MH shell (only available within the message handling system, mh) SYNOPSIS
msh [-help] [-prompt string] [file] OPTIONS
Prints a list of the valid options for this command. Sets the prompt for msh. If the string you specify includes white space, you must enclose it in double quotes ("). If you do not specify this option, the default prompt is (msh). The following defaults are used by msh: file defaults to -prompt (msh) DESCRIPTION
The command msh is an interactive program that implements a subset of the normal MH commands operating on a single file in packf format. That is, msh is used to read a file that contains a number of messages, as opposed to the standard MH style of reading a number of files, each file being a separate message in a folder. The chief advantage of msh is that, unlike the normal MH style, it allows a file to have more than one message in it. In addition, msh can be used on other files, such as message archives which have been packed using packf. When invoked, msh reads the named file, and enters a command loop. You can type most of the normal MH commands. The syntax and semantics of these commands typed to msh are identical to their MH counterparts. In cases where the nature of msh would be inconsistent with the way MH works (for example, specifying a +folder with some commands), msh will duly inform you. The commands that msh currently supports are: ali burst comp dist folder forw inc mark mhmail msgchk next packf pick prev refile repl rmm scan send show sortm whatnow whom In addition, msh has a help command which gives a brief overview of all the msh options. To terminate msh, either type <CTRL/D>, or use the quit command. If the file is writable and has been modified, then using quit will ask you if the file should be updated. A redirection facility is supported by msh. Commands may be followed by one of the following standard symbols: Open an interprocess chan- nel; connect output to another command. Write output to file. Append output to file. If file starts with a tilde (~), then a C-shell-like expansion takes place. Note that commands are interpreted by sh(1). When parsing commands to the left of any redirection symbol, msh will honor the backslash () as the quote next-character symbol, and dou- ble quotes (") as quote-word delimiters. All other input tokens are separated by white space (spaces and tabs). You may wish to use an alternative profile for the commands that msh executes; see mh_profile(4) for details of the $MH environment vari- able. RESTRICTIONS
The msh shell is not the C-shell, and a lot of the facilities provided by the latter are not present in the former. In particular, msh does not support back-quoting, history substitutions, variable substitutions, or alias substitutions. msh does not understand back-quoting. The only effective way to use pick inside msh is to always use the seq select option. If you add the following line to your pick will work equally well from both the shell and msh: pick: -seq select -list There is a strict limit of messages per file in packf format which msh can handle. Usually, this limit is 1000 messages. PROFILE COMPONENTS
Path: To determine your Mail directory Msg-Protect: To set protections when creating a new file fileproc: Program to file messages showproc: Program to show messages FILES
The user profile. The system customization file. SEE ALSO
csh(1), packf(1), sh(1), mh_profile(4) msh(1)
All times are GMT -4. The time now is 06:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy