08-14-2008
Thank you guys, all of you have given very relevent and precise answers to my query.
although i am a J2EE app developer, and some how i am into UNIX now and that was first shell script, so i had lot of doubts, and u guys cleared it now.
joeyg,
reason being i was doing ls -ld directory_name is, if there is a directory then it gives exit staus 0 and if not it gives 1, based on this value i was creating a directory.
but
era, is write pipeline is treated as command by shell and if it is feeded to "if" statement it always gives exit 0.
thanks era.
Franklin52
i am making a Debian package to install and configure sun directory, opensso, openssl, so there i have to check at some places whather directory exists or not if not then i have to make it for the installation purposes.
thanks guys, i will look forward to your valuable help again.
cheers bye.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Apologize if this is doesn't come under this group. I have a small script to find out users who last logged in to check there mail. (Tru 64 4.0, Netscape mail 3.6)
----->
cat $1|awk -F: '$2=="SMTP-Accept" && $5~/@maildomain/ {s=$5;u++;las=substr($1)} END {for (i in u) {print... (2 Replies)
Discussion started by: nitin
2 Replies
2. Shell Programming and Scripting
Hello
i am trying to remove a line using an input file , but this depends upon user interaction
here is the sample
#!/bin/sh
echo "Please enter whether you want to remove Profile"
read value1
if ;then
sed /movie/d temp.txt> temp3.txt
else
echo "Script didnot remove profile"
fi
... (3 Replies)
Discussion started by: ranga27
3 Replies
3. Shell Programming and Scripting
Could some one help me on this... For loop is working...!
for x in $i
do
for y in $j
do
z=`echo $y | awk '{print $2}'`
if
then
FS=`/usr/bin/echo $y`
echo $FS >>$Basic_location/out.csv
fi
done
CPRT="Cpoyright @ BTOIDCIM"
done (3 Replies)
Discussion started by: bullz26
3 Replies
4. UNIX for Dummies Questions & Answers
If then else segment of below code is not working. For each filename code is displaying output for if part as well as else part. Please help its urgent.
for usercusttop in `echo ${filename}|sort|uniq|cut -c 1-${actualwordcount}`
do
... (2 Replies)
Discussion started by: findprakash
2 Replies
5. Shell Programming and Scripting
here we go..
While loop is not working file.. It also invokes one more shell scripts for which parameters need to passed on.
while read line
do
####
#### We want to have a logfile for each load
####
PLog="${LogDir}/${Script}.log";
####
... (5 Replies)
Discussion started by: premkumardr
5 Replies
6. Shell Programming and Scripting
hi everyone
i am facing a very strange problem . please help me why my while loop is not working.
below is my code
#!/bin/ksh
file=RCMC_ABC_999_080924_210813.DAR
echo ${file}
value=001
count=10
echo "abc"
echo ${count}
value=$((${value} + 1 ))
echo ${value}
while ]
do
echo... (3 Replies)
Discussion started by: aishsimplesweet
3 Replies
7. Shell Programming and Scripting
Hi All,
For loop in ksh not working if it was given in the following method.
simple script:
for i in {1..4}
do
echo $i
done
Output:
{1..4}
Even below also not working :(
Script:
for (( c=1; c<=5; c++ )) do echo "Welcome $c times..." done
Output:
./x.sh: 0403-057 Syntax error... (13 Replies)
Discussion started by: girish_satyam
13 Replies
8. Programming
Hi new to C give me a hand thank.
do
{
bzero(input,256);
printf("Please enter the country name!");
scanf("%s",input); //& character is essential for scanf(), %f = float, %399s as the last character to be the null character ('\0').
}
while... (5 Replies)
Discussion started by: GQiang
5 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I have ten different files to extract. so I thought for loop will help me. but it's not working for me. Please advice what I am doing wrong.
for INCI in 1 2 3 4 5 6 7 8 9 10
do
tar -xvf Update_INCI11.10.002_lnx86_1of10.tar
done
second file name is... (3 Replies)
Discussion started by: samnyc
3 Replies
10. Shell Programming and Scripting
Hello all,
I would like to unzip some files with a for-loop.
Is there anyone who could tell me how I should do this - in a correct way?
for file in $(ls); do echo gzip -d < $file | tar xf -; done
The problem is the pipe - I believe. But how could I do it? I need it for the command... (4 Replies)
Discussion started by: API
4 Replies
LEARN ABOUT DEBIAN
ccd2iso
CCD2ISO(1) User Commands CCD2ISO(1)
NAME
ccd2iso - convert IMG format to ISO format
SYNOPSIS
ccd2iso [FOO.IMG] [BAR.ISO]
DESCRIPTION
ccd2iso converts FOO.IMG to ISO format and writes the result to BAR.ISO. If fewer arguments than expected are given, ccd2iso will print
its help message and quit. If more arguments than expected are given, ccd2iso will silently ignore them and use only the first two argu-
ments.
IMG files are raw-data copies of optical media, generated primarily by the Windows application CloneCD, and are primarily used to store CDs
with odd properties, such as sectors which need to have read errors when read. Conversion to ISO format removes this information, as ISO
format does not support this.
IMG files almost always include a SUB file, which contains additional data for the disc format, and a CCD file, which is a plaintext con-
figuration file describing the disc layout. ccd2iso does not make use of these files, but the applications which generate them expect them
to have the same FOO prefix as the IMG file.
LIMITATIONS
ccd2iso currently only copies the first session of multisession discs, as well as outputting a harmless warning of Unrecognized sector
mode.
ccd2iso utterly ignores the additional data in CCD or SUB files.
SEE ALSO
mdf2iso(1), nrg2iso(1)
AUTHOR
This manual page was written by Rich Ercolani <rercola@acm.jhu.edu>, for the Debian GNU/Linux distribution (but it may, of course, be used
by others), because the original program lacked a manual page. It may be distributed under the same terms as ccd2iso, the GNU GPL version
2 or later, at your option.
ccd2iso 0.3 June 2006 CCD2ISO(1)