10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am checking for existence of files with the same extensions
#! /usr/bin/ksh
txtfiles = '*.txt'
if
then
cp ${dirpath}/${txtfiles} ${dir2path}
fi
I am getting the following error
line 5: [: too many arguments for the if check condition (4 Replies)
Discussion started by: chen.sara
4 Replies
2. Solaris
SunOS 5.10 Generic_142900-15 sun4v sparc SUNW,T5240
I have a script that needs to test a file for the existence of a trailer record. Is there a command and is a header and trailer differect record type?
Thanks in advance (1 Reply)
Discussion started by: Harleyrci
1 Replies
3. Shell Programming and Scripting
Hello,
Can you please help me to see if log files exist in a directory?
I need to scan logs in different directories, so I am using an array to change dynamically.
I need help in the if test statement
dir=/logs/MSD
dir=/logs/UPD
countA=1
while (( countA <= ${#dir
} ))
do
cd ${dir}... (1 Reply)
Discussion started by: drbiloukos
1 Replies
4. Shell Programming and Scripting
deleted (1 Reply)
Discussion started by: ust
1 Replies
5. Shell Programming and Scripting
Hi,
i have a file which contains data in fixed length. each row contains data of 10 characters fixed length. The data in the file appears like 4567782882
some times i may recieve dat less than fixed length of 10. in such a case i find nulls appended at the trailing spaces when i do a... (2 Replies)
Discussion started by: meeragiri
2 Replies
6. UNIX for Dummies Questions & Answers
Hello,
Im trying write a bash sript to search a file and identify any file names that contain a space at the end of them.
I was trying to use the grep command but I can find how I would identify the character I'm looking for.
Any help would be grately appreciated. (2 Replies)
Discussion started by: gintreach
2 Replies
7. Shell Programming and Scripting
Hi
How can I check if the path exist or not?
echo "Enter path:";
read my_path;
##I should check whether my_path exists or not.... (5 Replies)
Discussion started by: tjay83
5 Replies
8. Programming
Hi everybody,
I need to check in C program whether a given login is known on the system. Is there any system function that could do this ?
So far, all I could find is getpwnam(), which answers my problem by parsing the local password database. But won't work if a user is authenticated by... (2 Replies)
Discussion started by: xavier054
2 Replies
9. Shell Programming and Scripting
I'm using the following line in bash to test whether an argument supplied is an absolute path or not:
if echo $1 | grep '^/' > /dev/null
then
absolute=1
else
absoute=0
fi
The line appears to work but seems somewhat unprofessional looking to me. Is it an acceptable... (2 Replies)
Discussion started by: dkieran
2 Replies
10. Shell Programming and Scripting
ok im doing this in a normal shell. i need to check the file in the script. how should i write the if else statment?
if the filesize contains 0kb then it will echo out file contains nothing
else if the script contains more than 0kb then it will echo out file exist.
any one care to help?... (3 Replies)
Discussion started by: forevercalz
3 Replies