01-23-2011
echo $line | tr '|' '\n' >> $2
Hi I am already using this in my code. My problem is get the same spaces as in the input file.
please replace the <6spaces> with spaces when trying the code and let me know the solution ,..
Waiting for ur response
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am having this problem......when I run this script:
print -n "Enter file name to be deleted: "
read answer
if
then
rm $name
else
echo "No such file with the name: $name exists"
fi
I was trying to test my script for errors, and basically when the user had files with the rights: 400,... (1 Reply)
Discussion started by: Makaveli.2003
1 Replies
2. IP Networking
Hi
My computer of late started misbehaving. Whenever I switch it on
It say Override and then it takes long to boot. Surprising is that it opens excel automatic. What could be that? (1 Reply)
Discussion started by: Mulo
1 Replies
3. UNIX for Advanced & Expert Users
On Sun Solaris 8 I would like a user to post via FTP a file with a put command with higher permission than the standard 644. For instance 664.
I don't know how to perform it.
Thank you in advance. (4 Replies)
Discussion started by: cagnod
4 Replies
4. AIX
When the aix date function is called by a routine, is the date function 'aware' of the name of the routine that is calling it, such that if we had the source code of the date function, we could modify it so that it provides a date to the caller depending upon the identity of the calling routine.... (1 Reply)
Discussion started by: gerry shacter
1 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I've searched and read, and searched and read some more; but I'm still not connecting the dots or understanding what I need to change.
I have a script that creates a file. If I run it as root, the file gets created with 644 permissions like I want. That seems to make sense (at least I... (2 Replies)
Discussion started by: 65bit
2 Replies
6. Shell Programming and Scripting
I send an attachment 123.pdf using the below script:-
<< script content >>
#!/usr/bin/ksh
/usr/lib/sendmail -C sendmail.cf abc@gmail.com << END
Subject: HELLO
`uuencode 123.pdf 123.pdf`
END
However, the message I got in gmail look like:-
begin 644 123.pdf
... garbage ...
... many... (4 Replies)
Discussion started by: pok.fung
4 Replies
7. Shell Programming and Scripting
Hi,
When I login to my HP-UX and fire the "set" command I see that the weblogic 9.2 classpath is already set.
However, I wish to override the classpath to weblogic version 10.3
I have a script call setWLSEnv.sh that has the desired classpath.
Thus, in my unix script i write
.... (6 Replies)
Discussion started by: mohtashims
6 Replies
8. Shell Programming and Scripting
Hi All,
I'm using Ksh 88 version.
I'm trying to remove the files using the below script .The code is working fine but i'm getting override protection 644 (yes/no)?
message for every file .. Pelase suggest
#!/usr/bin/ksh
set -x
File_Path="/etc/home/logs"
Dest_Path="/etc/home/temp"... (1 Reply)
Discussion started by: smile689
1 Replies
9. AIX
Hi,
We are using AIX machines. How to create all files generated in a directory with 644 permissions automatically.
Regards,
Suresh (11 Replies)
Discussion started by: suresh3566
11 Replies
rm(1) General Commands Manual rm(1)
Name
rm, rmdir - remove (unlink) files or directories
Syntax
rm [-f] [-r] [-i] [-] file-or-directory-name...
rmdir directory-name...
Description
The command removes the entries for one or more files from a directory. If there are no links to the file then the file is destroyed. For
further information, see
The command removes entries for the named directories, which must be empty. If they are not empty, the directories remain, and displays an
error message (see EXAMPLES).
To remove a file, you must have write permission in its directory, but you do not need read or write permission on the file itself. When
you are using from a terminal, and you do not have write permission on the file, the command asks for confirmation before destroying the
file.
If input is redirected from the standard input device (your terminal), then checks to ensure that input is not coming from your terminal.
If not, sets the -f option, which overrides the file protection, and removes the files silently, regardless of what you have specified in
the file redirected as input to See EXAMPLES.
Options
- Specifies that the named files have names beginning with a minus (for example ).
-f Forces the removal of file or directory without first requesting confirmation. Only system or usage messages are displayed.
-i Prompts for yes or no response before removing each entry. Does not ask when combined with the -f option. If you type a y, followed
by any combination of characters, a yes response is assumed.
-r Recursively removes all entries from the specified directory and, then, removes the entry for that directory from its parent direc-
tory.
Examples
The following example shows how to remove a file in your current working directory.
rm myfile
This example shows use of the null option to remove a file beginning with a minus sign.
rm - -gorp
This example shows how a confirmation is requested for removal of a file for which you do not have write permission.
rm testfile
rm: override protection 400 for testfile? y
This example shows how the combination of -i and -r options lets you examine all the files in a directory before removing them. In the
example, mydirectory is a subdirectory of the current working directory. Note that the last question requests confirmation before removing
the directory itself. Although the user types ``y'', requesting removal of the directory, the command does not allow this, because the
directory is not empty; the user typed ``n'' to the question about the file file2 , so file2 was not removed.
rm -ir mydirectory
rm: remove mydirectory/file1? y
rm: remove mydirectory/file2? n
.
.
.
rm: remove mydirectory? y
rm: mydirectory: Directory not empty
This example illustrates that overrides file protection when input is redirected from the standard input device. The user creates a file
named ``alfie'', with a read-only file protection. The user then creates a file named ``ans'' to contain the character ``n''. The command
following destroys the file ``alfie'', even though the redirected input file requested no deletion.
cat > alfie
hello
^d
chmod 444 alfie
cat > ans
n
^d
rm < ans alfie
See Also
unlink(2)
rm(1)