Sponsored Content
Top Forums UNIX for Dummies Questions & Answers echo appends to a read-only file Post 302382352 by thegeek on Wednesday 23rd of December 2009 05:01:42 AM
Old 12-23-2009
buddy, you have to understand this thing, root has all power.

For super user, the permission bits will not be cross checked, so not only echo, cat, other editors and anything can edit the files if you are working as super user.

From wiki:
Code:
root is the conventional name of the user who has all rights or permissions (to all files and programs)

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script That Appends

I am trying to write a bash script that takes a file as an argument and appends my name if this file ends in .txt... I am not sure how to do this though. Any help is greatly appreciated! (4 Replies)
Discussion started by: GTRocker8824
4 Replies

2. Shell Programming and Scripting

how to read a file to an echo statement

I was searching for an option where i can echo some strings together with the contents of a file. Eg. I was to echo the below string to a file "alter application PMS_ add variable CurrYear Y2009;" >> ${ESS_MAXL_DIR}/PMS_SUB.txt The value 2009 is coming from a file called date.txt without the... (3 Replies)
Discussion started by: Celvin VK
3 Replies

3. Shell Programming and Scripting

While read do, then echo, gives double output

Sorry about the title, but this should be fairly self-explanatory. My script seems to work, except that in the output, below, the first three lines are correct, but why does it print the additional lines 4, 5, & 6? Script: #!/bin/bash while read; do client="$(grep -m 1 Client | awk... (3 Replies)
Discussion started by: MrKen
3 Replies

4. Shell Programming and Scripting

echo ls to a file and then read file and selectively delete

I'm trying to write a script that will do an ls of a location, echo it into a file, and then read that file and selectively delete files/folders, so it would go something like this: cd $CLEAN_LOCN ls >>$TMP_FILE while read LINE do if LINE = $DONTDELETE skip elseif LINE =... (2 Replies)
Discussion started by: MaureenT
2 Replies

5. Shell Programming and Scripting

read variable after echo

Hi, i want to create an user-friendly script where you are asked for two numbers. i would like that these two number to be separated with "--" for example, but i can't figure out how to do this. for example read -p "Insert lowest and highest value: " min ; echo -n "-- "; read max so... (3 Replies)
Discussion started by: ezitoc
3 Replies

6. UNIX for Dummies Questions & Answers

When reading a csv file, counter to read 20 lines and wait for minute then read next 20 till end

Hello All, i am a newbie and need some help when reading a csv file in a bourne shell script. I want to read 10 lines, then wait for a minute and then do a reading of another 10 lines and so on in the same way. I want to do this till the end of file. Any inputs are appreciated ... (3 Replies)
Discussion started by: victor.s
3 Replies

7. Shell Programming and Scripting

How to read in a part of an echo line?

Hello, I have a very basic script #!/usr/bin/ksh while print ' ' print ' 1. View Command History ' print ' 2. List files in current Directory ' read opt'?Enter Option> ' ;do if ;then fc -l fi # if ;then ls -la I want to... (10 Replies)
Discussion started by: Grueben
10 Replies

8. Shell Programming and Scripting

How to read each line from input file, assign variables, and echo to output file?

I've got a file that looks like this (spaces before first entries intentional): 12345650-000005000GL140227 ANNUAL HELC FEE EN 22345650-000005000GL140227 ANNUAL HELC FEE EN 32345650-000005000GL140227 ANNUAL HELC FEE EN I want to read through the file line by line,... (6 Replies)
Discussion started by: Scottie1954
6 Replies

9. Shell Programming and Scripting

Shell script to read specified value from file and echo to the same location to other file.

Hello. I want to to backup some "default:" values from a file do some other job and after restore that "default:" values back. The problem is that the source and destination file has a lot of default: strings in it but with different values... So.. Here is an example: A part of my source... (6 Replies)
Discussion started by: ausdim
6 Replies

10. Shell Programming and Scripting

Ftp bash script appends to file using cron instead of coping new file

I have a bash script that is running a mysql query and creating a csv file with a time stamp. It then uploads that to a ftp server. Everything works great when I manually run it. But then I have a cron job set to run every monday, wednesday and friday at 5am est. When the cron job runs, it... (7 Replies)
Discussion started by: akallenberger
7 Replies
CHFLAGS(1)						    BSD General Commands Manual 						CHFLAGS(1)

NAME
chflags -- change file flags SYNOPSIS
chflags [-R [-H | -L | -P]] [-h] flags file ... DESCRIPTION
The chflags utility modifies the file flags of the listed files as specified by the flags operand. The options are as follows: -H If the -R option is specified, symbolic links on the command line are followed. (Symbolic links encountered in the tree traversal are not followed.) -L If the -R option is specified, all symbolic links are followed. -P If the -R option is specified, no symbolic links are followed. -R Change the file flags for the file hierarchies rooted in the files instead of just the files themselves. -h If the file or a file encountered during directory traversal is a symbolic link, the file flags of the link itself is changed. Flags are a comma separated list of keywords. The following keywords are currently defined: Keyword Flag Permission arch archived super-user only opaque opaque owner or super-user nodump nodump owner or super-user sappnd system append-only super-user only schg system immutable super-user only uappnd user append-only owner or super-user uchg user immutable owner or super-user Putting the letters ``no'' before an option causes the flag to be turned off. For example: nouchg the immutable bit should be cleared The -H, -L and -P options are ignored unless the -R option is specified. In addition, these options override each other and the command's actions are determined by the last one specified. The -o option of ls(1) is used to display the flags. The chflags utility exits 0 on success, and >0 if an error occurs. The kernel does not allow the flags on block and character devices to be changed except by the super-user. SEE ALSO
ls(1), chflags(2), lchflags(2), stat(2), fts(3), symlink(7), dump(8), init(8) BSD
May 14, 2010 BSD
All times are GMT -4. The time now is 10:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy