Search Results

Search: Posts Made By: Shan_u2005
2,121
Posted By Shan_u2005
Thanks Franklin, It does work. But, doesn't...
Thanks Franklin,

It does work. But, doesn't AWK work in a similar way as SED i.e. it does refer the newline character to check for the end of the line?

---------- Post updated at 03:53 PM...
2,121
Posted By Shan_u2005
Help substituting text in a file having a single line but no newline char
Hello,

Need help substituting a particular word in a file having a single line but no newline character at the end.

I was trying to use sed but it doesn't work probably because there is no...
12,501
Posted By Shan_u2005
Thanks a lot. It does help.
Thanks a lot. It does help.
12,501
Posted By Shan_u2005
Understanding ampersand (&) usage in the command
Please explain the usage of ampersand in the following command

who & echo "Total number of users are `who|wc -l`"


What I understand is that ampersand is used to run some process in the...
3,153
Posted By Shan_u2005
Does this help? $ cat inputfile 2010...
Does this help?



$ cat inputfile
2010 1 02
2010 2 01
2010 3 05

$ cat inputfile | sed -e 's/ /0/1;s/ //1'
20100102
20100201
20100305
2,654
Posted By Shan_u2005
fixpart="/etc/usr/transfer_script # transferring...
fixpart="/etc/usr/transfer_script # transferring to a system"

The fixpart is a variable which is being assigned the value,

/etc/usr/transfer_script # transferring to a system

What the...
3,398
Posted By Shan_u2005
Hi, Didn't understand the second part of the...
Hi,

Didn't understand the second part of the question i.e. to search from the beginning or end. Can you please demonstrate with an example?

Does the below code help?

#!/usr/bin/sh

echo...
2,380
Posted By Shan_u2005
Priyanka, I tried this and it is working...
Priyanka,

I tried this and it is working fine,

if test -e $1
then
echo "File Exist in the current directory"
fi
echo "Employee details born in 1990 or drawing a salary greater than...
2,916
Posted By Shan_u2005
Kartheek, For your 3rd query, the output would...
Kartheek,
For your 3rd query, the output would be 5 as wc -c gives the no of bytes and it does include the new line character as well.

Also, if you have the same command for execution in the case...
16,672
Posted By Shan_u2005
Sushma, If I understand correctly then, for...
Sushma,
If I understand correctly then, for your 2nd query you can simply do a tail -1 and then cut the field whose value you require,

e.g. to get the last row value in the first field,

tail...
3,710
Posted By Shan_u2005
I am still not very clear but I would try to...
I am still not very clear but I would try to answer whatever little I have understood.

You can use,
$ grep -c ^ a.txt # this will get you the no of lines or records in your file

you can...
3,710
Posted By Shan_u2005
Hello, What do you mean my records? Do they...
Hello,

What do you mean my records? Do they mean line numbers?

Thanks,
Shantanu
11,185
Posted By Shan_u2005
Hi, I tried by replacing the single quotes (')...
Hi,
I tried by replacing the single quotes (') with a (`) and it did seem to be able to find the function but then it was having trouble executing the commands in the called function :eek:
...
9,426
Posted By Shan_u2005
Well, you can first add 20 spaces at the end of...
Well, you can first add 20 spaces at the end of each line (assuming that all the lines are of fixed length of 280 chars each) and then use your sed command to add the text at the end of the line....
6,477
Posted By Shan_u2005
Yes, it will definitely work...
Yes, it will definitely work...
16,672
Posted By Shan_u2005
You could use something like this, cat...
You could use something like this,


cat tst.csv | awk -F";" '{v1=$0;split(v1,names,";");for (idx=1;idx<NF+1;idx++) print idx, names[idx];}'

The input file is,
$ cat tst.csv
1;2;3;4;5;6;7;8...
8,308
Posted By Shan_u2005
Thanks all Shantanu
Thanks all
Shantanu
8,308
Posted By Shan_u2005
Thanks Jsmithstl, But, $ is used for variable...
Thanks Jsmithstl,
But, $ is used for variable subsitution. How is the use of $ in this expression related to that? Could you please explain more?

Thanks,
Shantanu
8,308
Posted By Shan_u2005
Test command - Two square brackets
Hello,
Can someone please explain to me the following line,
[[ -z $(echo $c | tr -d "\015") ]] && break

I do not understand why two test square brackets are used.

Thanks,
Shantanu
...
Showing results 1 to 19 of 19

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