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.
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)
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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT NETBSD
chflags
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