Search Results

Search: Posts Made By: pinnacle
1,189
Posted By Don Cragun
Hi pinnacle, I find this very confusing. ...
Hi pinnacle,
I find this very confusing.

You haven't said what shell or operating system you're using, but from the [[ expression ]], I assume that you're not using a Bourne shell and that you...
1,189
Posted By Aia
substitute echo for printf printf "%d%02d\n"...
substitute echo for printf
printf "%d%02d\n" $c, $b
1,620
Posted By Scrutinizer
Try: paste -sd \| in.txt
Try:
paste -sd \| in.txt
15,420
Posted By Scrutinizer
If the files contain 1 extra digit (for instance...
If the files contain 1 extra digit (for instance a version number somewhere) then most of these methods will not render the correct results. You could select on the basis of how many digits need to...
15,420
Posted By anbu23
$ ls adio_idfl_201302_df.txt ...
$ ls
adio_idfl_201302_df.txt dalkd_20130301.csv dfa_201301_dll.ctl
$ ls | tr -dc [:digit:]
20130220130301201301
$ ls | tr -dc '[\n[:digit:]]'
201302
20130301
201301
1,728
Posted By Don Cragun
Note that in all of these cases, the shell (not...
Note that in all of these cases, the shell (not echo, ls, or printf) is expanding the pattern to produce a list of files. Which command you should use to process that list of files depends on what...
1,728
Posted By Don Cragun
This is overkill. You only need to use...
This is overkill. You only need to use ${x:?'error msg'} once for each different $x (the first time it is referenced). And, you won't be able to list the filenames after they have been removed. ...
21,046
Posted By Corona688
As a quick fix it will do, but you really should...
As a quick fix it will do, but you really should get a better shell, since this is a quite inefficient practice.


NEWNAME="`echo $OLDNAME | sed 's/_[0-9][0-9][0-9][0-9][0-9][0-9]_/_/'`"
2,738
Posted By Yoda
From KSH manual...
From KSH manual (https://www.unix.com/man-page/all/1/ksh/)
${parameter%pattern}
${parameter%%pattern}
If the shell pattern matches the end of the value of parameter,
then the value...
Showing results 1 to 9 of 9

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