Profile

Cover photo
The UNIX School
79 followers|82,843 views
AboutPostsPhotosVideos

Stream

The UNIX School

Shared publicly  - 
 
grep vs awk - Part 2
In this article, we will see more awk alternatives for the frequently used grep commands. This is in continuation to the grep vs awk - Part 1 .
Let us consider a sample file as shown below: $ cat file
Unix

Linux
Uniix
Solaris
AIX
ArchLinux
Ubuntu 1. Search...
In this article, we will see more awk alternatives for the frequently used grep commands. This is in continuation to the grep vs awk - Part 1. Let us consider a sample file as shown below: $ cat file Unix Linux Uniix Solaris ...
1
Add a comment...

The UNIX School

Shared publicly  - 
 
Perl : Find files using File::Find
H ow to find the list of files in Perl  like the UNIX find command? The answer is  File::Find  CPAN module. Let us see in this article how to use the File::Find module. File::Find :    File::Find module contains 2 modules: find and finddepth. Both are used ...
1
Add a comment...

The UNIX School

Shared publicly  - 
 
How to use SUID for shell scripts in Linux?
Question : How to write a shell script which will read the required passwords/connect strings from a config file? Other users should be able to execute the scripts, however they should not be able to read the config file. Say, I have a config file, myconfig...
1
Add a comment...

The UNIX School

Shared publicly  - 
2
Kaustubh Ghanekar's profile photo
 
Just what and right when I needed!
Add a comment...

The UNIX School

Shared publicly  - 
 
How to remove duplicate element from arrays in Perl? Let us see in this article how can duplicates be removed in different ways? 1. Copying distinct elements to new array using grep function: my @arr=qw(bob alice alice chris ...
1
Add a comment...

The UNIX School

Shared publicly  - 
 
How to find the sum of all the digits in a number or a string? OR How to find the sum of all elements in array? Let us see the different ways how it can be done in Perl? 1. Divide and accumulate: my $...
1
Add a comment...

The UNIX School

Shared publicly  - 
 
How to use arrays in ksh?
  Array, as in any programming language, is a collection of elements. These elements need not be of the same type. One important difference here is shells support only one-dimensional arrays. 1. Creating an array :    Creating an array is pretty simple. $ t...
Array, as in any programming language, is a collection of elements. These elements need not be of the same type. One important difference here is shells support only one-dimensional arrays. 1. Creating an array: Creating a...
1
Add a comment...

The UNIX School

Shared publicly  - 
 
sed - 20 examples to remove / delete characters from a file
In this article of sed series , we will see the examples of how to remove or delete characters from a file. The syntax of sed command replacement is: $ sed 's/find/replace/' file  This sed command finds the pattern and replaces with another pattern. When th...
1
Add a comment...

The UNIX School

Shared publicly  - 
 
How to write an entire list of elements into a file? Let us see in this article how to write a list l1 to a file 'f1.txt': 1. Using write method: #!/usr/bin/python l1=['hi','hello','welcome'] f=open('f1.txt','w') for ele in l...
1
Add a comment...

The UNIX School

Shared publicly  - 
 
 In Perl, when an array is traversed using the foreach loop, the variable holding the element of the array during the iteration is actually an alias to the actual element itself. Due to this, any change done to this variable ...
1
Add a comment...

The UNIX School

Shared publicly  - 
 
How to fetch date and time related stuff within in Perl?    Sometimes, Perl developers resort to using of Unix system date command to fetch a date or time within Perl script. This is not needed at all since Perl itself has a ...
1
Add a comment...
Story
Tagline
Come, walk with us, let us explore the beauty of Unix.