08-12-2013
I found just now the issue not due to OS shell. But the syntax error arises when we use the below code in user function
shopt -s extglob
rm -rf !(test1|test2|test3)
---------- Post updated at 10:21 PM ---------- Previous update was at 10:14 PM ----------
Moved the line shopt -s extglob out of the user function and Issue resolved.
Thanks for all responses.
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
Can anyone help me with the following:
I want to make a backup from my (AIX) system.
But I don't want to backup a couple of temp-directories.
I tried it with the X-option, but that didn't work.
I hope that someone can help me.
Thanks in advance.
Corine (6 Replies)
Discussion started by: TheBlueLady
6 Replies
2. UNIX for Dummies Questions & Answers
Howdy
I have this directory structure ...
eep
eepaptest
eepfatest
eepgltest
eep.old
eeppoptest
ehf
ehfaptest
ehfgltest
ehp
ehpgltest
I want to find files in these directories, but I want to exclude eep, ehf & ehp.
Cany anyone help with the correct command ?? (1 Reply)
Discussion started by: SmurfGGM
1 Replies
3. Shell Programming and Scripting
Hello,
I have a line in my script to find the files changed in the last 24 hours. It is as below:
find /home/hary -type f -mtime -1
I now want to exclude a directory named "/home/hary/temp/cache" from the above find command. How do I add it to my script?
Any help is appreciated.
... (9 Replies)
Discussion started by: tadi18
9 Replies
4. Shell Programming and Scripting
Hi Forum.
I'm trying to write a script that finds and deletes files that are older than 300 days. The script will read a table that contains the following 3 columns:
1st col: “Y” means sub-directory scan; "N" means no subdirectory scan
2nd col: sub-directory location
3rd col: File prefix... (7 Replies)
Discussion started by: pchang
7 Replies
5. Shell Programming and Scripting
Hi.,
I have a script, in which I am processing a files present in the directory types.
ls -lrt | grep ^d | grep Dir_type | awk -f '{print $9}' |\
while read dir_name; do
#operations
done
where Dir_type is the pattern in which directories get created. How to filter out empty... (2 Replies)
Discussion started by: IND123
2 Replies
6. Shell Programming and Scripting
Hi,
I use find command to list all the files in a directory and its sub-directories, but the problem is to exclude certain directories during search. Can i give the directory names in command line to skip them and search rest of the directories?
For example i have directories:
test
../test1... (1 Reply)
Discussion started by: nmattam
1 Replies
7. Programming
Hi, I am writing an sql query in which i have to choose only that url that are from particular host but are not zip files. something like:
select * from mytable where url like '%myhost%' and url not like '%zip%'
Is there a simple way to combine these two condition into one? (3 Replies)
Discussion started by: vickylife
3 Replies
8. AIX
Hi, im having some issues after i execute the next command:
tar -cvf /varios/restore/test.tar -X /jfma/test1/excludefile /jfma | gzip -c > /varios/restore/test.tar.gz
this creates the desired "test.tar.gz" file, but whe i try to open it it says "tar: 0511-164 There is a media read or write... (6 Replies)
Discussion started by: blacksteel1988
6 Replies
9. Shell Programming and Scripting
Can you please help tweak the below command to exclude all directories with the name "logs" and "tmp"
find . -type f \( ! -name "*.tar*" ! -name "*.bkp*" \) -exec /usr/xpg4/bin/grep -i "user_1" /dev/null {} + >result.out
bash-3.2$ uname -a
SunOS mymac 5.10 Generic_150400-26 sun4v sparc sun4v... (9 Replies)
Discussion started by: mohtashims
9 Replies
MEWLS(1) General Commands Manual MEWLS(1)
NAME
mewls - Message scanner for Mew
SYNOPSIS
mewls [options] [folder [range]]
DESCRIPTION
The mewls utility extracts necessary fields from messages stored in folders. This command is necessary for Mew to implement the asynchro-
nous feature.
The options are as follows:
-a Print all necessary fields when picking.
-b dir Set the Mail home to dir.
-c dir Set the News home to dir.
-d field
Set th field to be extracted to field.
-e command
Specify an external command to fetch mailbox.
-m options
Specify options for command.
-f fields
Specify fields to display.
-h Display this help message.
-i file Set the input stream to file.
-l length
Set the field max length to be extracted to length. The default value is 3. 0 means no limit.
-n Don't use fstat().
-p pattern
Specify the pick pattern.
-s src Set message source to src : '+folder range'.
-w time Set the wait_for timer to timer (microsecond).
-v Display the version.
Definitions of the symbols above are as follows:
range N | [start]-[end] | last:N
pattern 'key=val' | 'key!=val' | '!<pattern>' | '(<pattern>)' | '<pattern>&<pattern>' | '<pattern>|<pattern>'
BUGS
If a field is long, only the beginning three lines are extracted by default.
March 17, 2001 MEWLS(1)