01-30-2009
Regarding Readable check for all the files in the folder
Currently we are doing the migration to unix to linux.
I am facing the new problem
kganeshb@its04489:~/scripts $ ls -l | more
total 340
-rw-r----- 1 kganeshb users 9038 Oct 22 13:23 109_db.txt
-rw-rw---- 1 dlc users 1413 Oct 10 17:40 1.txt
-rw-rw---- 1 kganeshb users 45 Jan 28 13:46 a
-rw------- 1 kganeshb users 197 Dec 26 13:19 aa
-rw-rw---- 1 kganeshb users 99 Jan 28 13:37 aaa
-rw-rw---- 1 kganeshb users 110 Jan 28 12:29 aaa.sh
-rw-r--r-- 1 kganeshb users 11146 Sep 29 15:36 aat.txt
-rw-rw---- 1 kganeshb users 58 Dec 29 19:03 aa.txt
-rw-rw---- 1 kganeshb users 639 Jan 8 11:48 add.sh
My script
if [ -r * ]
then
echo "read"
else
echo "non read"
fi
output
bash: [: too many arguments
non readable
Our most of the script using the -r * option.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I was wondering if there's a command in Linux that would check to see if a CD is inserted into CD-rom.
I am developing a shell script that would copy a file from CD rom. For this, I have to first verify if the CD has been inserted or not.
Can anyone help me?
Thanks,
Sundeep (1 Reply)
Discussion started by: eamani_sun
1 Replies
2. Shell Programming and Scripting
Hi friends..
I hav a problem....
I dont know how to check .c files exists r not in a folder using IF in C shell script
actually i tried like this
if(=~ *.c)
even though some .c files or there in the current folder..it is not entering int o the if control statement...... (17 Replies)
Discussion started by: p.hemadrireddy
17 Replies
3. Shell Programming and Scripting
Hi all,
I have copied all my files to one folder.and i want to check how many files (count) in the folder recently moved or total files in my folder?
please send me the query asap. (3 Replies)
Discussion started by: durgaprasad
3 Replies
4. Shell Programming and Scripting
i want to check the readability of a file inside the script.
when i use
if
then
echo the file "$sourcef" is not readable
else
echo something
fi
i am getting the error : f: unknown test operator
when i tried to check the availability with
if
i was... (3 Replies)
Discussion started by: gotam
3 Replies
5. Shell Programming and Scripting
All,
I have a script where I get a filename as input and do some processing with the file that I got as input.
Requirement:
Now I have a requirement where I need to check the following:
If either of this goes wrong, the script should pop out a warning message.
I tried searching the... (6 Replies)
Discussion started by: bharath.gct
6 Replies
6. Shell Programming and Scripting
hi all,
in ksh script how do i detect if a file is readable by others ??
thanks. (6 Replies)
Discussion started by: cesarNZ
6 Replies
7. Shell Programming and Scripting
Hi I am having a problem to verify existence of files. I need to know whether or not files in a folder that begins with a name.
For example all files that start with The_File_ *.
I was doing it this way, but gives me error.
if text -f /work/The_File_*
then
...
else
..
fi (5 Replies)
Discussion started by: Rodrih92
5 Replies
8. Shell Programming and Scripting
New Unix user/scripter here. Been trying to solve a problem for two days now with no luck. Hoping someone here has an answer.
Essentially I have a list of wtmp files which I have decompressed and copied to a temporary directory. Using the following command I can turn them into a file than can... (4 Replies)
Discussion started by: Stryfe16
4 Replies
9. Shell Programming and Scripting
I have a folder with 100s of dat files, with delimiter "|", in some files they didn't provide this delimiter. how to automatically check those list of files in a folder which doesnt have a delimiter or string this way "|" is it possible?
Thank you very much for the helpful info. (3 Replies)
Discussion started by: cplusplus1
3 Replies
10. Shell Programming and Scripting
Hello.
I am comparing two binary file.
The first file is the source file. The second file is a modified version of the first one.
Modification concern uuid value.
Example
first file have multiple occurrences of 69a3604b-ac2b-43b7-af84-0a4a67fc6962 second file have the same occurence... (1 Reply)
Discussion started by: jcdole
1 Replies
RMM(1) [nmh-1.5] RMM(1)
NAME
rmm - remove messages
SYNOPSIS
rmm [+folder] [msgs] [-unlink | -nounlink] [-version] [-help]
DESCRIPTION
By default, rmm will remove the specified messages by renaming each of the message files with a site-dependent prefix (usually a comma).
Such files will then need to be removed in some manner after a certain amount of time. Many sites arrange for cron to remove these files
once a day, so check with your system administrator.
Alternately, if you wish for rmm to really remove the files representing these messages, you can use the -unlink switch. But messages
removed by this method cannot be later recovered.
If you prefer a more sophisticated method of `removing' messages, you can define the rmmproc profile component. For example, you can add a
profile component such as
rmmproc: /home/foouser/bin/rmm_msgs
then instead of simply renaming the message file, rmm will call the named program or script to handle the files that represent the messages
to be deleted.
Some users of csh prefer the following:
alias rmm 'refile +d'
where folder `+d' is a folder for deleted messages, and
alias mexp 'rm `mhpath +d all`'
is used to "expunge" deleted messages.
The current message is not changed by rmm, so a next
will advance to the next message in the folder as expected.
FILES
$HOME/.mh_profile The user profile
PROFILE COMPONENTS
Path: To determine the user's nmh directory
Current-Folder: To find the default current folder
rmmproc: Program to delete the message
SEE ALSO
refile(1), rmf(1)
DEFAULTS
`+folder' defaults to the current folder
`msgs' defaults to cur
`-nounlink'
CONTEXT
If a folder is given, it will become the current folder.
BUGS
Since refile uses your rmmproc to delete the message, the rmmproc must NOT call refile without specifying -normmproc, or you will create an
infinte loop.
MH.6.8 11 June 2012 RMM(1)