10-31-2007
while - comparision
Hi,
Please find the attached scriplet and suggest me to fix the bug in this.
-----------------------------------
noofdirs=`ls *.tar | wc -l`
if [ "$noofdirs" != 0 ] ; then
let i=1
while ( $i <= $noofdirs ) ;
do
echo $i
mkdir $i
file1=`ls *.tar | head -1`
mv $file1 $i
i = `expr $i + 1`
echo $i
done
fi
------------------------------------
I want to create the directory according to tar files. If i 3 tar file, it shuold create 3 directories by the name 1,2 and 3.
Rgds,
Sharif.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello,
I am trying to compare two dates which are in variables and i am not getting the correct result as expected.
$first_date = '07/19/2007'
$second_date='07/20/2007'
Can you please suggest how to i check whether they are equal or not.
if ($first_date -eq $second_date) condition is not... (3 Replies)
Discussion started by: kotasateesh
3 Replies
2. Shell Programming and Scripting
HI,
I would like to know how to compare two files and replace non-matching lines with "_" .
I can get non-mathing lines with
grep -v -f file1 file2
i just want to knw how to display 'file2' with non-matching lines from 'file1' replaced by "_"
for exmaple
file1:
a
b
c
d
... (2 Replies)
Discussion started by: maddy81
2 Replies
3. Shell Programming and Scripting
Hi All
I have to files
cat a.txt
AAA
BBB
CCC
DDD
and
cat b.txt
AAA
CCC
EEE
i want to compare these two files and o/p should have content of file a.txt which is not in file b.txt
c.txt
BBB
DDD
Please help me (1 Reply)
Discussion started by: aaysa123
1 Replies
4. Shell Programming and Scripting
Hi All
I have to files
cat a.txt
AAA
BBB
CCC
DDD
and
cat b.txt
AAA
CCC
EEE
i want to compare these two files and o/p should have content of file a.txt which is not in file b.txt
c.txt
BBB
DDD
Please help me (3 Replies)
Discussion started by: aaysa123
3 Replies
5. UNIX for Advanced & Expert Users
File Structure
file1.txt.arch
029429288,1,,,02087400376,N,02087400376,N,0,02087400376,N,0,0,8010,08000151736,U,N,,08000151736,U,20100726111237,20100726111237,0,20100726111651,00004140,16,16,10,N;... (1 Reply)
Discussion started by: ravigupta2u
1 Replies
6. Shell Programming and Scripting
I have a string like ab or abc of whatever length. But i want to know whether another string ( for example, abcfghijkl, OR a<space> bcfghijkl ab<space> cfghijkl OR a<space>bcfghijkl OR ab<space> c<space> fghijkl ) starts with ab or abc... space might existing on the longer string... If so, i... (1 Reply)
Discussion started by: nram_krishna@ya
1 Replies
7. Shell Programming and Scripting
I want to compare two strings using awk dynamically without trimming the spaces and want to find the count of matching string.
Input Strings file:
File1 content (file1):
" a "
" a2 "
File2 content (file2):
" a "
" a "
" a2 "
" b2 "
" c2 "... (3 Replies)
Discussion started by: AhmedLakadkutta
3 Replies
8. Shell Programming and Scripting
I have two files. one files contain counts and second contain string. Now i have to compare two string . if two string are same i have to add count. If strings are same more than once i have to display final output.
like this
>Count.txt
1
3
12
4
5
6
1
>strings.txt
AA
BB
BB... (1 Reply)
Discussion started by: pjlotiya
1 Replies
9. UNIX for Advanced & Expert Users
Hi,
I need to know how to compare the permissions of files which are in two different directories in Unix..
Experts - can any one help on this..!!! (1 Reply)
Discussion started by: yanis
1 Replies
10. Shell Programming and Scripting
Hi Everyone
I am new to Unix shell scripting
Can anyone please explain me in detail how this command works
awk -F@ 'NR==FNR{A=$2;next}$3 in A{$3=A}1' file2 file1
The above command I got it from this forum, but unable to implement it as I am not getting how this works:mad:
I... (3 Replies)
Discussion started by: Vijay90
3 Replies
LEARN ABOUT LINUX
apport-bug
apport-bug(1) General Commands Manual apport-bug(1)
NAME
apport-bug, apport-collect - file a bug report using Apport, or update an existing report
SYNOPSIS
apport-bug
apport-bug symptom | pid | package | program path | .apport/.crash file
apport-collect report-number
DESCRIPTION
apport-bug reports problems to your distribution's bug tracking system, using Apport to collect a lot of local information about your sys-
tem to help the developers to fix the problem and avoid unnecessary question/answer turnarounds.
You should always start with running apport-bug without arguments, which will present a list of known symptoms. This will generate the most
useful bug reports.
If there is no matching symptom, you need to determine the affected program or package yourself. You can provide a package name or program
name to apport-bug, e. g.:
apport-bug firefox
apport-bug /usr/bin/unzip
In order to add more information to the bug report that could help the developers to fix the problem, you can also specify a process ID
instead:
$ pidof gnome-terminal
5139
$ apport-bug 5139
As a special case, to report a bug against the Linux kernel, you do not need to use the full package name (such as linux-
image-2.6.28-4-generic); you can just use
apport-bug linux
to report a bug against the currently running kernel.
Finally, you can use this program to report a previously stored crash or bug report:
apport-bug /var/crash/_bin_bash.1000.crash
apport-bug /tmp/apport.firefox.332G9t.apport
Bug reports can be written to a file by using the --save option or by using apport-cli.
apport-bug detects whether KDE or Gnome is running and calls apport-gtk or apport-kde accordingly. If neither is available, or the session
does not run under X11, it calls apport-cli for a command-line client.
UPDATING EXISTING REPORTS
apport-collect collects the same information as apport-bug, but adds it to an already reported problem you have submitted. This is useful
if the report was not originally filed through Apport, and the developers ask you to attach information from your system.
OPTIONS
Please see the apport-cli(1) manpage for possible options.
ENVIRONMENT
APPORT_IGNORE_OBSOLETE_PACKAGES
Apport refuses to create bug reports if the package or any dependency is not current. If this environment variable is set, this
check is waived. Experts who will thoroughly check the situation before filing a bug report can define this in their ~/.bashrc or
temporarily on the command line when calling apport-bug.
SEE ALSO
apport-cli(1)
AUTHOR
apport and the accompanying tools are developed by Martin Pitt <martin.pitt@ubuntu.com>.
Martin Pitt September 08, 2009 apport-bug(1)