10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file: file.txt, which contains the following data in it.
This is a file, my name is Karl, what is this process, karl is karl junior, file is a test file, file's name is file.txt
My name is not Karl, my name is Karl Joey
What is your name?
Do you know your name and... (3 Replies)
Discussion started by: anuragpgtgerman
3 Replies
2. Solaris
I am trying to find the home directory of users on a UNIX (Solaris/AIX) box using
echo ~usernameThis does return the home directory for all valid users. For some reason this command also outputs home directory which are non-existent for few users who seem not to have logon access to that... (31 Replies)
Discussion started by: thinkster
31 Replies
3. Shell Programming and Scripting
Hi All,
Hope you guys had a wonderful weekend
I have a scenario where in which I have to read a file line by line
and check for few words before redirecting to a file
I have searched the forum but,either those answers dint work (perhaps because of my wrong under standing of how IFS... (6 Replies)
Discussion started by: Kingcobra
6 Replies
4. Shell Programming and Scripting
Can someone give me a tip on writing a script that, for each file in the working directory, prints the filename, the # of lines, and the # of words to stdout? (2 Replies)
Discussion started by: flash123
2 Replies
5. Shell Programming and Scripting
Hi Gurus.
This is driving me a bit batty. I now if must be a simple matter but I cant find anything that references it.
I have a housekeeping script that searches for some huge dump directories then removes them using rm -rf.
find ./ -name 'ab' -exec rm -rf {} \;
This works but always... (7 Replies)
Discussion started by: rinser
7 Replies
6. UNIX for Dummies Questions & Answers
I want to delete the last word of each line in all the files in one directory but dont know what I am doing wrong
FILES="data/*"
for X in $FILES
do
name=$(basename $X)
sed s/'\w*$'// $X > no-last/${name}
done
Can you please help me :wall: (8 Replies)
Discussion started by: A-V
8 Replies
7. Shell Programming and Scripting
Hi,
Why is it I cannot compare the return value of 'wc -w' to an integer?
Please see code below:
a="x y z"
b=`echo ${a} | wc -w`
if ; then
echo "less than 4"
fi
when I try to run error always happen (: integer expression expected)
- error is on the if statement
Please... (1 Reply)
Discussion started by: h0ujun
1 Replies
8. Shell Programming and Scripting
Hi All,
I have a requirement where I need to get the all file names present in a particular directory in to a single separated by space,
I have files in /home/RAAM/work directory as
test1.xls
test2.xls
test3.xls
I need to get all filenames from that directory in single line like ... (6 Replies)
Discussion started by: Raamc
6 Replies
9. Shell Programming and Scripting
i have a file in this pattern
MATCH1 word1 IMAGE word3 word4
MATCH2 word1 word2 word3 word4
MATCH2 word1 word2 word3 word4
MATCH2 word1 word2 word3 word4
MATCH2 word1 word2 word3 word4
MATCH1 word1 IMAGE word3 word4
MATCH2 word1 word2 word3 word4
MATCH2 word1 word2 word3 word4
MATCH2 word1... (7 Replies)
Discussion started by: bangaram
7 Replies
10. Shell Programming and Scripting
Hi All
I was wondering what is the most efficient way to find files in the current directory(that may contain 100,000's files), that meets a certain specified file type and of a certain age.
I have experimented with the find command in unix but it also searches all sub directories. I have... (2 Replies)
Discussion started by: kewong007
2 Replies