06-15-2014
I wouldn't rely on the "file" command to provide any definitive answer about the intended use or format of a file. It's notoriously inaccurate and IMO is more of a "hint" for interactive use then anything else.
10 More Discussions You Might Find Interesting
1. Programming
Hi All
I am simulating a problem in the production where i faced a situation.
Please find the following example program which i simulated.
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
char str1; (3 Replies)
Discussion started by: dhanamurthy
3 Replies
2. Shell Programming and Scripting
i have no idea abount shell script but i need need shell script to get last 10 char from a file name and write in to a new file.
consider u hav 5 files in a particular dir i script should get last 10 char of each file n write the 10 char in separate files (2 Replies)
Discussion started by: raj0390
2 Replies
3. Shell Programming and Scripting
I've this file and need to sort the data in each group
File would look like this ...
cat file1.txt
Reason : ABC
12345-0023
32123-5400
32442-5333
Reason : DEF
42523-3453
23345-3311
Reason : HIJ
454553-0001
I would like to sort each group on the last 4 fileds and print them... (11 Replies)
Discussion started by: prash184u
11 Replies
4. Shell Programming and Scripting
Hi all,
I'm reading a file with this layout:
First_Col Second_Col
The Second_Col has values as 1000, -1, 10, 43...
While reading the file I'm getting the second column value with awk command, but it is including the CR control char.
do
item_saved=`echo $b | awk '{print... (4 Replies)
Discussion started by: mrreds
4 Replies
5. Programming
hi
I have the below code to convert hexa to binary. It is working fine, but i want to store the binary in char or int. The below program is printing the result.
void ConvertHexToBinary(char sHexValue)
{
int i;
printf("Binary Equivalent=");
for(i=0;sHexValue!=NULL;i++)
{
... (1 Reply)
Discussion started by: atharalikhan
1 Replies
6. Shell Programming and Scripting
Hi
I am using sed command to make SCORE=somevalue to SCORE=blank in a file.
Please see the attached lastline.txt file. After executing the below command on the file, it removes the last line.
cat lastline.txt | sed 's/SCORE=.*$/SCORE=/g' > newfile.txt
Why does sed command remove the... (3 Replies)
Discussion started by: ashok.k
3 Replies
7. Shell Programming and Scripting
/etc/group
tiadm::345:mk789,po312,jo343,ju454,ko453,yx879,iy345,hn453
bin::2:root,daemon
sys::3:root,bin,adm
adm::4:root,daemon
uucp::5:root
/etc/passwd
mk789:x:234:1::/export/home/dummy:/bin/sh
po312:x:234:1::/export/home/dummy:/bin/sh
ju454:x:234:1::/export/home/dummy:/bin/sh... (6 Replies)
Discussion started by: chidori
6 Replies
8. Shell Programming and Scripting
path = content.txt
filename = application
directory = _modules
define create
$(eval from := $(shell echo $$1)) \
$(eval to := $(shell echo $$2)) \
sed -i '' 's/$(from)/$(to)/g' content.txt
endef
all:
clear
$(eval modules := $(shell egrep -o "{module+\}" $(path)))
... (1 Reply)
Discussion started by: bmson
1 Replies
9. Shell Programming and Scripting
I am trying to add a unique identifier to two file extensions .bam and .vcf in a directory located at /home/cmccabe/Desktop/index/R_2016_09_21_14_01_15_user_S5-00580-9-Medexome.
The identifier is in $2 of the input file. What the code below is attempting to do is strip off the last portion... (21 Replies)
Discussion started by: cmccabe
21 Replies
10. UNIX for Advanced & Expert Users
Unix File is pipe delimited with 17 fields. We may get extra pipes in data also.
We may get \n char (1 or more \n in one field or multi fileds) in data in any field.
Need to replace \n true ( line separator) with 'space and bell char space' chars (' \a ') Not data \n.
Input:... (1 Reply)
Discussion started by: rajeshkumare
1 Replies
LEARN ABOUT CENTOS
file::homedir::unix
File::HomeDir::Unix(3) User Contributed Perl Documentation File::HomeDir::Unix(3)
NAME
File::HomeDir::Unix - Find your home and other directories on legacy Unix
SYNOPSIS
use File::HomeDir;
# Find directories for the current user
$home = File::HomeDir->my_home; # /home/mylogin
$desktop = File::HomeDir->my_desktop; # All of these will...
$docs = File::HomeDir->my_documents; # ...default to home...
$music = File::HomeDir->my_music; # ...directory
$pics = File::HomeDir->my_pictures; #
$videos = File::HomeDir->my_videos; #
$data = File::HomeDir->my_data; #
DESCRIPTION
This module provides implementations for determining common user directories. In normal usage this module will always be used via
File::HomeDir.
SUPPORT
See the support section the main File::HomeDir module.
AUTHORS
Adam Kennedy <adamk@cpan.org>
Sean M. Burke <sburke@cpan.org>
SEE ALSO
File::HomeDir, File::HomeDir::Win32 (legacy)
COPYRIGHT
Copyright 2005 - 2011 Adam Kennedy.
Some parts copyright 2000 Sean M. Burke.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.16.3 2012-10-19 File::HomeDir::Unix(3)