10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm trying to reverse every even line in my file using the awk command below but it prints only the odd lines but nothing else:
$ awk '(NR % 2) {print}; !(NR % 2) {print | "rev";}' myfile
Any idea what I might have done wrong?
Thank you. (10 Replies)
Discussion started by: ivpz
10 Replies
2. Shell Programming and Scripting
hi,
how to I do this?
i="4.000"
if ; then
echo "smaller"
fi
how do I convert the "4.000" to 4?
Thanks! (4 Replies)
Discussion started by: h0ujun
4 Replies
3. Programming
Hi all,
I jus wanna print string b after reversing it. but the out put is blank. My code snippet is below. :wall:
int main()
{
char * a, * b;
b = new char;
a = new char;
int len, le;
le = 0;
cout<< " enter your string \n";
cin>> a;
len = strlen(a);
for(int i =... (8 Replies)
Discussion started by: vineetjoshi
8 Replies
4. Shell Programming and Scripting
Just check out the script...
1 #!/bin/bash
2
3 echo -n "Enter a string :: "
4 read str
5 echo -n "Reverse is :: "
6 l=`expr length "$str"`
7 while
8 do
9 m=`echo $str | cut -c "$l"`
10 echo -n $m
11 ... (3 Replies)
Discussion started by: lipun4u
3 Replies
5. Shell Programming and Scripting
hi,
I have to reverse the command output like below:
output:
online
offline
disable
maintening
killed
How to reverse this output like:
killed
maintening
disable
offline
online
It should be ksh script. (4 Replies)
Discussion started by: a2156z
4 Replies
6. Shell Programming and Scripting
i am using AIX -ksh
how can i reverse any file ,i have already try tac cmd it is not in AIX:
please help me out. (3 Replies)
Discussion started by: RahulJoshi
3 Replies
7. Shell Programming and Scripting
hey guys,
can anybody help me out here on the following:
grep '^\{1,3\}\.\{1,3\}\.\{1,3\}\.\{1,3\}$' ravi.txt mary.txt lisa.txt https://www.unix.com/images/misc/progress.gif
i.e what i did was found ip addreses from different files
and then i want... (1 Reply)
Discussion started by: ravis83
1 Replies
8. Shell Programming and Scripting
Hello,
How do i sort a csv file. i should be sorting column1(varchar),column2*(varchar) in ascending and column4 in descending order(numeric datatype).
I tried few combinations of sort, but doesn't seem to be getting the right result.
sort -t "," -k 1 -k 2 -k 4nr file
any help is... (3 Replies)
Discussion started by: markjason
3 Replies
9. Shell Programming and Scripting
Hi Everybody,
I want to write a script in unix which will automatically FTP a .txt file from my client machine D: drive(Windows)
That is I want to FTP a file from my PC to UNIX box but this should be done from UNIX box by a shell script. (i.e. I will invoke the script in UNIX and FTP will be... (4 Replies)
Discussion started by: ganesh123
4 Replies
10. Shell Programming and Scripting
when I do
$ ls z*
List of all files begining with 'z'. But what if I want to do a reverse lookup. Just for interest sake ;)
$ ls ztr
should be same as
$ ls ztr*
$ ls zt*
$ ls z* (2 Replies)
Discussion started by: azmathshaikh
2 Replies