So I get the length of each line, but some of the lines seem to be too long... I get the following message...
nawk: input record `textofline...' too long
input record number 32840, file /directory/filename
source line number 1
So the script stops running at that record. What is the character...
I have a text file and I'd like to count the number of characters in each line. Ultimately, I want to sum up the number of lines by how many characters are in it, but first how do you get a count per line?
I have a file that has repeating commas and I'd like to replace them with a single comma (effectively, creating a csv file). The challenge is that there can be an infinite number of repeating commas. For example,
field1,field2
field1,,field2
field1,,,,,,,,,field2
So how can I do the...
Trying to use one sed command to delete the following 3 characters "[]
Tried...
sed "s/[\"\[\]]//g" filename
It did not work, but when I just include 2 of these escaped characters in the set, it works fine. Any ideas?
I have a text file with spaces. In vi, I want to search and replace the spaces with a tab character... what is the correct syntax? I tried the following in command mode, which just replaced the spaces with a "t".
:%s/ /\t/g
I have a mailx script that emails a text message to about 50 recipients. Is there a limit that I should be aware of?
Also, I can't seem to get the -b option (blind carbon copy) to work. The only options I need are -s for the subject, -b, and then the main recipient's email address. What's the...
Thanks Alex. But I do assign the values of the variables earlier in the same script. Wouldn't that make the variables available while in crontab? Or are you saying I have to "hard code" in the path and file names when using crontab?
My shell script wc's a few files (stands for word count, right?) and uses mailx to put the results in the body of an email. It works perfectly when invoked manually at the command line, however, after setting up the same script in crontab, the body of the resulting email comes out blank.
The...
Disregard... figured it out... the script was basically looking in the wrong directory for the cat file. Who would've thought you had to look in the right place!
Need help troubleshooting why my ftp script doesn't work. Previous threads suggested a script like the following to ftp a file that has a filename with yesterday's date.
First, this 11:59pm script creates a file with the appropriate date...
date +%m-%d-20%y > /sasuser/leexjx4/prod/yday.txt...
I just get the standard end of line "$" marker after each line and then a final one at the end...
0 1 * * 1 volumes.sh$
0 5 * * * mc.sh$
$
I seem to recall something about that final line being needed (or maybe it was not needed?) but I've tried both and still nothing.
If I swap them around, mc.sh still doesn't work, so I guess the order doesn't matter. I copied this script from the volumes.sh script that does run which is why I'm thinking it's a crontab issue, not a script issue. Any other ideas? Am I neglecting something fundamental?
I have the following crontab file
0 1 * * 1 volumes.sh
0 5 * * * mc.sh
and it results in "Your crontab file has an error in it... unexpected end of line". The first runs fine, but the second doesn't (the scripts are not the problem). What am I missing here?!!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.