Summary: hi , i have a comma seperated file with 1 line which is terminating with a comma in last now i wanted to remove the last comma. can any one tell me ho...
Summary: The 'cat -n' puts the line number (right justified) and a tab at the beginning of each line. Next, the first sed statement chops each line up into 3 f...
Summary: Matin, your logic of: "delete any LF found if the location of LF is less than the length of the line" will not work because in unix, an LF will not be...
Summary: #!/bin/ksh M=$(date '+%m') Y=$(date '+%Y') D=$(date '+%d') # execute cal command, reverse the output, delete blank lines, grab first line # and print ...
Summary: It is very easy to waste the first line. awk could do an initial getline to waste it, or tail +1 would do it. But the last line is much more of a pa...
Summary: awk does the getlines (into $0 buffer) for you automatically. A basic awk solution will not use an explicit getline, but getline comes in very handy ...
Summary: Here is an awk solution. Â That match expression insists on 14 non-bar characters followed by a bar character followed by anything. Â It would recogni...
Summary: Try this: #change the num to the lines you want to join num=3 count=$num cat textfile | while read lines do if [ "$count" != "1" ]; then echo $lines |...
Summary: For grep, the -v option will negate (or reverse) the result set. grep red grep -v red grep -e red -e blue -e pink grep -ve red -e blue -e pink sed can...
Summary: Found out the solution Guys: sed '1,1d' outfile > newfile My file always started with a page break, so I delete the first line of the file using sed a...
Summary: Hi, Can someone tell me how to append some text to the last line. Basically i have a last line of a file as follows user1:password i would like to ap...
Summary: I have very big file, which contains almost alternate blank lines. Can anybody suggest me how to delete those lines? I don't want to go on individual ...
Summary: - I need to read and ignore a file till i find a certain string and then write out the rest of the file in to another file using sh ... can some one ...
Summary: I have a script that I wat to set some variables from an external file. The file, "x", has entries such as : 1 2 3 I want to set the variable in my s...
Summary: hi, i am not doing integer aritmatic. i need to pick up a line from the file path.txt using sed command. with sed -n 1p path.txt will give me the fir...
Summary: for I in `cat /etc/mnttab |grep ufs | cut-f2` The main line of your for-loop is executing a nested command (in this case it is a series of piped comma...
Summary: Anybody know how to get sed to delete lines up to (but not including) a certain line? To delete all up to and including the line, I use 1,/whateve...
Summary: In regards to the Jim script, for some reason the return code comes back as 0 after every two lines. So out put looks like this: param2 (stop/ param2 ...
Summary: Hi, I've been working on a log script and I keep running into problems with the code. Can anyone help me? I'd like the script to read each line in a ...
Summary: Here are a couple of different approaches, and each of these support any number of words on a line. To preserve my indentation for better readability,...
Summary: Can anyone help me with this assignment. Write a shell script file to read 5 student names (First and Last name) and their grades using a while loop....
Summary: Thanks nails & james. But what i am looking for is - I have, say 3 functions which runs in background All functions are editing single text file to...