using <B>Bourne shell</B> how can I list all files in such a directory that file name don't match a pattern.
e.g:
a dir. /mydir contains these files
[tamer001]-/mydir$ ls
2001-01-23.log
2001-01-23_08-30.log
2001-01-23_15-59.log
2001-01-24_00-00.log
2001-01-24_11-52.log
2001-01-24_18-34.log
2001-01-25.log
2001-01-25_13-30.log
I want to move all files except the files of 25th of the month (which is today files) and rename the files by adding a string to the begining of the file name.
so here what I did:
how can I exclude moving today log files from the dir /mydir ?
please help.
[Edited by tamer on 01-28-2001 at 05:42 PM] added code tags for readability --oombera
Sorry for the duplicate thread this one is similar to the one in
https://www.unix.com/shell-programming-scripting/88132-awk-sed-script-read-values-parameter-files.html#post302255121
Since there were no responses on the parent thread since it got resolved partially i thought to open the new... (4 Replies)
I need a commnad to modify a file's contents from:
2009-06-18 14:14:38 CST INF Thread-114 rlo.aaf_ - MASSHANDLE: Got a valid message<Location=""><bob>2</bob><carol>61</carol><ted>54</ted><alice>1m</alice>
to this :
2009-06-18 14:14:38 CST INF Thread-114 rlo.aaf_ - MASSHANDLE: Got a... (4 Replies)
We have 2 file XML files - FILE1.XML and FILE2.xml - we need copy the contents of FILE1.XML and replace in FILE2.xml pattern "<assignedAttributeList></assignedAttributeList>"
FILE1.XML
1. <itemList>
2. <item type="Manufactured">
3. <resourceCode>431048</resourceCode>
4. ... (0 Replies)
Hi,
As a newbie, I'm desperate ro make my shell script work. I'd like a script which checks all the files in a directory, check the file name, if the file name ends with "extracted", store it in a variable, if it has a suffix of ".roi" stores in another variable. I'm going to use these two... (3 Replies)
how can i call awk file "average.awk" (code as follows) with file commands like ls -s...
#!/bin/awk -f
BEGIN {
# How many lines
lines=0;
total=0;
}
{
# this code is executed once for each line
# increase the number of files
# lines++;
# increase the total size, which is field #1... (2 Replies)
hi,
I am trying to get the FileType using the File command. I have one file, which holds Group separator along with ASCII character.
It's a Text file.
But when I ran the File command the FileType is coming as "data".
It should be "ASCII, Text file".
Is the latest version of File... (6 Replies)
Hi,
file1.txt
AAA
BBB
CCC
DDD
file2.txt
abc|AAA|AAAabcbcs|fnwufnq
bca|nwruqf|AAA|fwfwwefwef
fmimwe|BBB|fnqwufw|wufbqw
wcdbi|CCC|wefnwin|wfwwf
DDD|wabvfav|wqef|fwbwqfwfe
i need the count of rows of file1.txt present in the file2.txt
required output:
AAA 2 (10 Replies)
Hi,
I am trying to attach a .log file or .txt file to mail command to send an email once my ksh script executed. I am unable to use mutt command as it has been not installed and i am not supposed to install it. I have tried many ways by googling which has not helped me to succeed.
Here is my... (5 Replies)
Hello.
The task :
Using multiple commands like :
gdisk -l $SOME_DISK >> $SOME_FILEI generate some text file.
For readiness I must insert page break.
When the program is finished I want to convert the final text file to a pdf file.
When finished, I got two files : One text file and One pdf... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT LINUX
rbash
RBASH(1) General Commands Manual RBASH(1)NAME
rbash - restricted bash, see bash(1)RESTRICTED SHELL
If bash is started with the name rbash, or the -r option is supplied at invocation, the shell becomes restricted. A restricted shell is
used to set up an environment more controlled than the standard shell. It behaves identically to bash with the exception that the follow-
ing are disallowed or not performed:
o changing directories with cd
o setting or unsetting the values of SHELL, PATH, ENV, or BASH_ENV
o specifying command names containing /
o specifying a file name containing a / as an argument to the . builtin command
o specifying a filename containing a slash as an argument to the -p option to the hash builtin command
o importing function definitions from the shell environment at startup
o parsing the value of SHELLOPTS from the shell environment at startup
o redirecting output using the >, >|, <>, >&, &>, and >> redirection operators
o using the exec builtin command to replace the shell with another command
o adding or deleting builtin commands with the -f and -d options to the enable builtin command
o using the enable builtin command to enable disabled shell builtins
o specifying the -p option to the command builtin command
o turning off restricted mode with set +r or set +o restricted.
These restrictions are enforced after any startup files are read.
When a command that is found to be a shell script is executed, rbash turns off any restrictions in the shell spawned to execute the script.
SEE ALSO bash(1)GNU Bash-4.0 2004 Apr 20 RBASH(1)