Search Results

Search: Posts Made By: kevin80
12,836
Posted By kevin80
Removing whitespace from files
Hello,
I was wondering if there was a way to write a script to do the following:


turn a file that contains:

1234 Kevin Smith 12:09 456235
1234 John ...
3,278
Posted By kevin80
I had picked up on the "printf" typo you made (Im...
I had picked up on the "printf" typo you made (Im not that new) but to no avail. But I found a different way to do it.
Thanks Anyway,

I now know how to use awk (after reading up on the man page)
3,278
Posted By kevin80
Thanks, although that didnt seem to work I...
Thanks, although that didnt seem to work
I figured it out.

Thanks Anyway !
3,278
Posted By kevin80
Why doesn't sort -k $number work ??
I know this seems like a stupid question.
I am trying to sort an address book. Some peole have first, middle and last names, some only have first and last names.

Eg:
Bob Hope
John Bon Jovi
etc...
4,083
Posted By kevin80
Don't worry. I found a solution. NAME="Bob...
Don't worry. I found a solution.

NAME="Bob Hope"
spacecount=0
for((i=0; i<${#NAME};i++))
if test ${NAME:$i:1} = " "
then
let 'spacecount=spacesount+1'
...
4,083
Posted By kevin80
Counting patterns in a shell string
Hello,

I am writing a shell script and I need to find a way to
count the number of whitespaces in a string.

Eg:
NAME="Bob Hope"
I am looking for a way to count the number of whitespaces in...
9,958
Posted By kevin80
Problem with UNIX cut command
#!/usr/bin/bash
cat /etc/passwd | while read A
do
USER=`echo “$A” | cut -f 1 -d “:”`
echo “Found $USER”
done


This shell script should make USER = the first field of...
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 12:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy