Search Results

Search: Posts Made By: llsmr777
1,348
Posted By llsmr777
Need help splitting file
I have a file with 58,000 lines
How can I easily split this file into 5 files with 10,000 lines and then the 6th with 8,000.

I need to do this for multiple files with different number of lines...
1,261
Posted By llsmr777
That worked like a charm! thank...
That worked like a charm! thank you!!![COLOR="#738fbf"]
1,261
Posted By llsmr777
Need help with script option
Hi,

So my script reads $1 on the command line.
example:
SCRIPT_NAME 1111

In my script I use a nawk statement to grab $1 but I also need it to read $1 from the variable (1111 from command line...
6,456
Posted By llsmr777
i tried the -s for test and it did not work. I...
i tried the -s for test and it did not work. I dont think we have that option in our environment or something?


As for print "file is not empty"
can I just do cat filename so it shows the...
6,456
Posted By llsmr777
Help with KSH script
I need to inside one of my scripts be able to view a file
if it's empty have a message that says - nothing in the file
and if it's not view the contents

I was trying to figure out the best and...
4,540
Posted By llsmr777
spaces or Tabs?
When formatting a script let's say for instance the following:

case ${choice} in
1)
vi ${tmp1}.tmp

# overwrite the tmp1 var with...
11,061
Posted By llsmr777
How to find files by hours old?
I need to be able to do the following:

Find files in multiple directories that are 6 hours older than the current time?
I am using KSH
I tried mmtime but it was not a valid option

Any help...
3,633
Posted By llsmr777
Ok here is what I changed it to. I haven't tested...
Ok here is what I changed it to. I haven't tested it because I wanted input first.


function build_list
{
for i in *$1*$2*
do
x=`echo $i | sed 's/\.Sent/\.Done/g'`
done
}

function...
25,907
Posted By llsmr777
Ok here is what I did. I dont know if it was at...
Ok here is what I did. I dont know if it was at all right. I haven't tested wanted to get input first.


function build_list
{
for i in *$1*$2*
do
x=`echo $i | sed 's/\.Sent/\.Done/g'`
done...
3,633
Posted By llsmr777
I put the done after I get my listing instead of...
I put the done after I get my listing instead of the end of the script.

Can I put my mv statement inside my Case Statement?

You asked me "how are you using it? We're not mind readers" to my...
3,633
Posted By llsmr777
Oh I'm sorry. I'm obviously clueless I know that!...
Oh I'm sorry. I'm obviously clueless I know that!

here is my code

for i in `ls -1 | grep $1 | grep $2`
do
x=`echo $i | sed 's/\.Sent/\.Done/g'`
echo mv $i DONE/$x
done
echo "Is this OK?"...
3,633
Posted By llsmr777
Ok so I changed it but after it asks me it only...
Ok so I changed it but after it asks me it only moved one file?
Should I not be using a case statement to perform the move?
I am using it to ask the user if the list is correct.

I thought that...
3,633
Posted By llsmr777
Thank you for your reply. I thought my case...
Thank you for your reply.

I thought my case statement was outside the loop?
3,633
Posted By llsmr777
Help can't get script to work how I need it to...
Hi thank you for anyone who responds.

Here is my script:
for i in `ls -1 | grep $1 | grep $2`
do
x=`echo $i | sed 's/\.Sent/\.Done/g'`
echo mv $i DONE/$x
echo "Is this OK?"
read...
5,682
Posted By llsmr777
BEGIN END questions
Why would you need to use this in a script?
Why can't you just use print to print out what you want printed in the begining and print for what you want at the end.

So this:

nawk 'BEGIN {print...
4,400
Posted By llsmr777
Jump to a specific place in a file?
If I cat a file
And want to go to the first instance of a particular value - what command would I use?
And then from that point where I jumped to search for another value - but only search from...
3,625
Posted By llsmr777
How to do multiple commands:
NEVERMIND figured it out!
3,037
Posted By llsmr777
Operators
I am trying to understand

Does the following:
{tmp+=$10}

Mean take $10 and add them all up and call it tmp

thanks!
1,425
Posted By llsmr777
thank you for the reply! can you expand on...
thank you for the reply!

can you expand on this? please bear with me I'm just learning:

grep -q "2007"; if [ $? -eq 0 ];

-q is option for what again?

[ $? -eq 0 ]; what does this break...
1,425
Posted By llsmr777
Need help writing a small script
Hi I am trying to do the following:

run a command that looks at a binary file and formats it
find the first line that has what I am looking for (there will be multiple)
print the name of the...
20,282
Posted By llsmr777
I'm sorry I'm still having a hard time...
I'm sorry I'm still having a hard time understanding:

" It adds an 'N' to the end of whatever reply was supplied, thereby creating a default should the user hit enter without typing anything. "
...
20,282
Posted By llsmr777
THank you for the replies! Please bear with me as...
THank you for the replies! Please bear with me as I am obviously very new to unix and scripting.

Dave Miller:
Can you break this down for me?
read answer
ans=`cat $answer"N" | cut -c1-1 | tr...
20,282
Posted By llsmr777
Thank for evaluating my script! for your...
Thank for evaluating my script!

for your comment: "Note that in your brief logic, you have it saying that it started AFTER it finished! You should put that line ABOVE the line where you go to the...
20,282
Posted By llsmr777
Thank you for the reply. No definately don't want...
Thank you for the reply. No definately don't want someone to write a script for me. I definately want to learn. I tried to google to see some examples but could not find any.

I have something...
20,282
Posted By llsmr777
basic script for yes and no answers
What is the basic syntax for a script that says

do you want to do this?
y - execute this
n - end
not y or n - end and print this

for example if I want to run this:
"Do you want to start...
Showing results 1 to 25 of 61

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