Search Results

Search: Posts Made By: omgsomuchppl
1,836
Posted By omgsomuchppl
Yes! Sorry i was lazy... I do have one more...
Yes! Sorry i was lazy...

I do have one more question.

if [ outputfile.txt == outputfile2.txt ]; then
echo "same"
else
echo "different"


Does that check for the contents of the text...
1,836
Posted By omgsomuchppl
Excute file then..
I have a text file with only the command:

MyTextFile:

ls -l

in it..

So in my sript im trying..

sh MyTextFile.txt >> MyTextFile.txt

Just to overwrite and replace the command with...
3,421
Posted By omgsomuchppl
sed '/^ *$/d' With or w/o spaces it really...
sed '/^ *$/d'

With or w/o spaces it really just doesnt want to.
3,421
Posted By omgsomuchppl
Why cant i delete blank lines?
I have a sed pipeline:


myVar=$(cat $FILE | sed -n '/regex/,/regex/{/regex/d;p}' | sed -n '/regex/!p' | sed -e s/[^:]*:// | sed /regex/,+8d \
)


sed '/^$/d'
sed '/./!d'

And i've...
4,155
Posted By omgsomuchppl
i might get in trouble if i post the actual text...
i might get in trouble if i post the actual text file and also the sed pipeline.
I think i have it figured out tho..And i dont want to quit until its done, so this is an all nighter for me..But as...
4,155
Posted By omgsomuchppl
new line after X'th feild? in awk or sed or grep...
new line after X'th feild? in awk or sed or grep or ..
4,155
Posted By omgsomuchppl
Eureka. U guys make things way to...
Eureka.

U guys make things way to complecated. hehe. i just used sed -n '1p' for the first line..
But im wondering..Is there a way to loop through so i dont have to use a different varaible for a...
4,155
Posted By omgsomuchppl
Well, what im after is to use awk or sed ( awk...
Well, what im after is to use awk or sed ( awk might be easiest ) to print each line of the file sepearately.

awk $NF1 ( for line 1 )
awk $NF2 ( for line 2 )

i dont know the syntax for it..
...
4,155
Posted By omgsomuchppl
Can i store the contents of the file into a...
Can i store the contents of the file into a varaible and still be able to delete blank lines? Thats what i've been trying
4,155
Posted By omgsomuchppl
Numbering a Text File
Running into a little problem with blank lines.

My file is of this format:

To number each line of the file i would use:


n=1
echo "$FILE" |
while read line
do
echo "$n) $line"...
1,739
Posted By omgsomuchppl
oops i had it twice
oops i had it twice
1,739
Posted By omgsomuchppl
Heres a more descriptive example of what im...
Heres a more descriptive example of what im after..Below is the code that im trying to use:

[code]
sed -e s/[^:*/]*://
[code]

Im just piping that code with a command file using cat..My 'test...
1,303
Posted By omgsomuchppl
see, im reading from a file, and these commands...
see, im reading from a file, and these commands appear all bunched up. Theres no way i can read them seperately if their not on their own individual lines.
1,303
Posted By omgsomuchppl
unbunchin several commands
I have a strange problem that i really cant figure out!

i have several commands bunched together on a single line.

Is there a way i can put them on their own individual lines?

I have:
...
1,739
Posted By omgsomuchppl
How about: This lol Using the code posted...
How about: This lol

Using the code posted above i would get, "This lol"
In some text files i would need How about
Is that possible with sed?
1,739
Posted By omgsomuchppl
sed help
I have a nasty little problem here. I'll feel much better when this is out of my way.

I need to delete everything on the line before the first occurence of a ':'
But in some circumstances, i...
5,093
Posted By omgsomuchppl
Double Spacing complex sed pipeline
my script:


FILE="$1"
echo "You Entered $FILE"
if [ -f $FILE ]; then
tmp=$(cat $FILE | sed '/./!d' | sed -n '/regex/,/regex/{/regex/d;p}'| sed -n '/---/,+2!p' | sed -n '/#/!p' | sed 's/^[\...
Showing results 1 to 17 of 17

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