05-07-2012
How to remove the first line of a file without using any temporary file
I want remove first line of the file without using any temporary file. Everything should be done in the original file itself since I don't any file creation access whereas I have modify access.
It would be great if somebody help in this regard ASAP .
Thanks in Advance.
Kishore
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
In the script I am creating a temporary file with process id as temp.txt.$$
I want to remove this tomporary file first from the current directory when i'll run the same script next time.
Note: Every time when the script executes then it has unique process id and it'll create a... (5 Replies)
Discussion started by: varungupta
5 Replies
2. Shell Programming and Scripting
I want to remove first line from a file containing 10K + records and want to put that into a new file.
Tried sed '1d' filename>newfile
This is writing all the records into new file.
Can somebody help please? (4 Replies)
Discussion started by: gpaulose
4 Replies
3. Shell Programming and Scripting
Hi All,
I have a file like below, how can i insert one line after line 1 without using a temporary file in perl?
line 1
line 2
line 3
expected result
line 1
new line <---insert here
line 2
line 3 (2 Replies)
Discussion started by: summer_cherry
2 Replies
4. Shell Programming and Scripting
Hi friends,
I have a doubt, I am not sure whether it is possible ah nu.
I am having a file(sample.txt) which contain 5 lines.
I want to remove 1st line in the file and save the file with same old name (sample.txt).
For removing 1st line i am using
sed 1d filename
But dono how to... (3 Replies)
Discussion started by: natraj005
3 Replies
5. Shell Programming and Scripting
Ok in my bash script i have 5 options to create a simple html script. I need to create a temporary file and whatever the user types will be stored in that file using html codes. And then I have another option in which that temporary file will be moved to the public_html directory in which the user... (19 Replies)
Discussion started by: gangsta
19 Replies
6. Shell Programming and Scripting
Hi-
How can I make the temporary file 0 byte , created inside gawk.
I am using
system("rm -f temp_orders");
It seems system command is deleting file permanently and I am not able to execute below statement.
print ORD_HEAD_FULL >> cFILE; (cFile is temp_orders) (2 Replies)
Discussion started by: ashish_kaithi
2 Replies
7. Shell Programming and Scripting
I wrote my unix archive script to move the zip files from unix input folder to windows folder,the zip files got successful transfered but while iam unzipping them in windows folder a new line is getting appended in my file..
how can i remove that new line..? (6 Replies)
Discussion started by: hemanthsaikumar
6 Replies
8. UNIX for Dummies Questions & Answers
How would I go about resolving this error
temporary mail message file: No such file or directory
Can anybody tell me where the default location is for the temporary mail message file is for mailx? It appears that it doesn't exist.
Thanks (1 Reply)
Discussion started by: joen
1 Replies
9. Shell Programming and Scripting
I have a file output.txt. File looks like this
name1 10
name2 2
name3 5
I get a number n and I need to remove all lines which has number (after name) smaller or equal to n number.
After that I need to write lines from file and my output must be like this:
Output: 'name1 10'
Output: 'name2... (1 Reply)
Discussion started by: kubo12312
1 Replies
LEARN ABOUT DEBIAN
setuid
SETUID(1) General Commands Manual SETUID(1)
NAME
setuid - run a command with a different uid.
SYNOPSIS
setuid username|uid command [ args ]
DESCRIPTION
Setuid changes user id, then executes the specified command. Unlike some versions of su(1), this program doesn't ever ask for a password
when executed with effective uid=root. This program doesn't change the environment; it only changes the uid and then uses execvp() to find
the command in the path, and execute it. (If the command is a script, execvp() passes the command name to /bin/sh for processing.)
For example,
setuid some_user $SHELL
can be used to start a shell running as another user.
Setuid is useful inside scripts that are being run by a setuid-root user -- such as a script invoked with super, so that the script can
execute some commands using the uid of the original user, instead of root. This allows unsafe commands (such as editors and pagers) to be
used in a non-root mode inside a super script. For example, an operator with permission to modify a certain protected_file could use a
super command that simply does:
cp protected_file temp_file
setuid $ORIG_USER ${EDITOR:-/bin/vi} temp_file
cp temp_file protected_file
(Note: don't use this example directly. If the temp_file can somehow be replaced by another user, as might be the case if it's kept in a
temporary directory, there will be a race condition in the time between editing the temporary file and copying it back to the protected
file.)
AUTHOR
Will Deich
local SETUID(1)