10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Dear all,
I was wondering If you could help me out.
I Am using a batch script to midfy some text files.
Input:
912856
912857
912904Amongst others I use this line:
REM I want to replace all lines that start with a 6-digit Number with a ftp command "get" followed by a path and the 6-digit... (9 Replies)
Discussion started by: SIEMI
9 Replies
2. UNIX for Advanced & Expert Users
Hi,
I have a file in unix with 15 columns.It consists special characters(#,$,^M,@,*,% etc)at the end of the each record.I want to remove these special characters.I used the following:
Sed -e 's/ /g;s/ */ /g'
. But It is removing special characters exists everywhere in the file(begining,middle... (24 Replies)
Discussion started by: rakeshp
24 Replies
3. UNIX for Beginners Questions & Answers
Hi Guys,
My requirement is to remove any invisible and special characters from the file like control M(carriage return) and alt numerics and it should not replace @#!$%
abc|xyz|acd¥£ó
adc|123| 12áí
Please help on this.
Thanks
Rakesh (1 Reply)
Discussion started by: rakeshp
1 Replies
4. Shell Programming and Scripting
Trying to run this command:
find /Volumes/Archive/ -type f -name "Icon"
and get
/Volumes/Archive//New Business and Marketing/2010 /Creative/Image Library/Stuff for Sean/Cafe Heineken/logo_Café Heineken_03.jpg: No such file or directory
due to the accent on the filename. Is there a way around... (2 Replies)
Discussion started by: kostas123334
2 Replies
5. Shell Programming and Scripting
Any time I do :
ls *.txt > mytext.txt
I get something like this in the output file:
^
Tue Jan 22 16:19:19 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
t1Fam_BrOv :~>alias | grep ls
alias l.='ls -d .* --color=tty'
alias lR='ls -R'
alias la='ls -Al'
alias lc='ls -ltcr'
alias ldd='ls -ltr |... (5 Replies)
Discussion started by: genehunter
5 Replies
6. UNIX for Dummies Questions & Answers
Hello all,
I am facing with a problem of invoking an environment variable.
If I use this command :
/bin/ls -lt FILE_NM_?(20120515|20120516)??????_sas.sig | head -n1 | awk '{print $9}'
It perfectly outputs the desired result.
FILE_NM_20120516000000_sas.sig
But if I do this:... (8 Replies)
Discussion started by: sethmj
8 Replies
7. Shell Programming and Scripting
I have a file that has the name in one of the lines as MARíA MENDOZA in Windows. When this gets FTPed over to UNIX it appears as MAR�A MENDOZA. Is there anyway to overcome this? Its causing a issue because the file is Postional and fields are getting pushed by 2 digits..
Any help would be... (4 Replies)
Discussion started by: venky338
4 Replies
8. Shell Programming and Scripting
Hi, I wish to replace a new line with br (html) but it doesn't seem to work
message=$(echo ${FORM_message} | tr '\r' '<br \/>' )
what it gives me seems to be ... b...?
I am also having problem escaping hash sign in cut command:
list=$(echo "$line" | cut -d'\#;\#' -f1) ;
my intention is... (2 Replies)
Discussion started by: ted_chou12
2 Replies
9. Shell Programming and Scripting
Hi,
I am creating a script to do a find and replace single/multiple lines in a file with any number of lines.
I have written a logic in a script that reads a reference file say "findrep" and populates two variables $FIND and $REPLACE
print $FIND gives
Hi How r $u
Rahul()
Note:... (0 Replies)
Discussion started by: r_sarnayak
0 Replies
10. UNIX for Dummies Questions & Answers
We have a unix file that contains special characters (ie. Ñ, °, É, ¿ , £ , ø ). When I try to read this file I get a codepage error and the characters are replaced by the # symbol. How do I keep the special characters from being read?
Thanks.
Ryan (3 Replies)
Discussion started by: Ryan2786
3 Replies
MKSTEMP(3) Linux Programmer's Manual MKSTEMP(3)
NAME
mkstemp - create a unique temporary file
SYNOPSIS
#include <stdlib.h>
int mkstemp(char *template);
DESCRIPTION
The mkstemp() function generates a unique temporary file name from template. The last six characters of template must be XXXXXX and these
are replaced with a string that makes the filename unique. The file is then created with mode read/write and permissions 0666 (glibc 2.0.6
and earlier), 0600 (glibc 2.0.7 and later). Since it will be modified, template must not be a string constant, but should be declared as a
character array. The file is opened with the O_EXCL flag, guaranteeing that when mkstemp returns successfully we are the only user.
RETURN VALUE
The mkstemp() function returns the file descriptor fd of the temporary file or -1 on error.
ERRORS
EINVAL The last six characters of template were not XXXXXX. Now template is unchanged.
EEXIST Could not create a unique temporary filename. Now the contents of template are undefined.
NOTES
The old behaviour (creating a file with mode 0666) may be a security risk, especially since other Unix flavours use 0600, and somebody
might overlook this detail when porting programs.
More generally, the POSIX specification does not say anything about file modes, so the application should make sure its umask is set appro-
priately before calling mkstemp.
CONFORMING TO
BSD 4.3, POSIX 1003.1-2001
NOTE
The prototype is in <unistd.h> for libc4, libc5, glibc1; glibc2 follows the Single Unix Specification and has the prototype in <stdlib.h>.
SEE ALSO
mkdtemp(3), mktemp(3), tmpnam(3), tempnam(3), tmpfile(3)
GNU
2001-12-23 MKSTEMP(3)