Search Results

Search: Posts Made By: mohtashims
42,753
Posted By vbe
Why use a pipe when it can be done within find...
Why use a pipe when it can be done within find command?
look at the man pages of man, especially after how to use multi criteria and the the exec
17,289
Posted By MadeInGermany
As I suggested, have -name "*.js?*" \! -name...
As I suggested, have -name "*.js?*" \! -name "*.jsp" or cheat with -name "*.js??*".
And most easy is of course -name "*.jsp?*".
13,061
Posted By RudiC
[^[:blank:]#;] # ONE char non-blank,...
[^[:blank:]#;] # ONE char non-blank, non-#, non-;
13,061
Posted By RudiC
Don't worry, your overcomplicated regex doesn't...
Don't worry, your overcomplicated regex doesn't match anything reasonable in your file, if that is what you're after (not clear from your spec). Even uncommented lines with # removed (which I added...
9,901
Posted By RudiC
Difficult to believe. How long would a string...
Difficult to believe. How long would a string need to be to buffalo awk?


What would that be, "non seek"?


How about
declare -A IPASS
IFS=,
for i in $iplist; do IPASS[$i]=${#IPASS[@]}; ...
9,901
Posted By Neo
Dear mohtashims, [reply before original...
Dear mohtashims,

[reply before original post edited]

With nearly 1000 posts on this site; you well know the culture here by this time.

You should post your code, what you have tried.

As...
17,114
Posted By RudiC
The ssh daemon is relevant on the target server....
The ssh daemon is relevant on the target server. Compare e.g. ssh.conf.
17,114
Posted By RudiC
Well - compare configurations and report back,...
Well - compare configurations and report back, that is...
8,363
Posted By nezabudka
Hi just add option echo -e $str1 > text.txt
Hi
just add option
echo -e $str1 > text.txt
8,363
Posted By Aia
echo $str1 | sed 's/\\n/\n/g' > text.txt
echo $str1 | sed 's/\\n/\n/g' > text.txt
6,195
Posted By nezabudka
egrep -o '(\S+\s+){2}\S+' <<<"$1" | awk ' ...
egrep -o '(\S+\s+){2}\S+' <<<"$1" |
awk '
{A[$1]; B[$3]; C[$2]}
END { print "TKT:" cat(A) "\n\nDEPT:" cat(B) "\n\nACTOR:" cat(C)}
function cat(T)
{ s=""; for (i in T)
...
Forum: Linux 12-23-2019
24,656
Posted By Neo
Yes, you did everyone correctly. Let me...
Yes, you did everyone correctly.

Let me think about it and get back to you later.

Thanks.
8,654
Posted By MadeInGermany
The shorter pathnames is a small improvement only...
The shorter pathnames is a small improvement only when post processing the output.
Then, you can bundle the names (shortens the command, not so much the run time).
But a + instead of the \; will...
6,042
Posted By Scrutinizer
Ah so it is the other way around? The hostname is...
Ah so it is the other way around? The hostname is always lowercase, but the path may be uppercase?

Try something like:
cd $(ls -d "$(hostname)"* "$(hostname | tr '[[:lower:]]' '[[:upper:]]')"*...
7,507
Posted By RudiC
There seems to be a mixup between shell globs and...
There seems to be a mixup between shell globs and grep / regex patterns. Try grep 'body.*.xml'.


Or, recent bashes provide "extended pattern matching" if the extglob shell option is set:
shopt...
11,066
Posted By Corona688
If your values will never contain spaces, you can...
If your values will never contain spaces, you can "pass" arrays as strings "val1 val2 val3" and split them back inside the function, like this:

#!/bin/ksh

set -A filelist val1 val2 val3
set -A...
7,178
Posted By apmcd47
I was going to say I agree with RudiC, but...
I was going to say I agree with RudiC, but realise $LINE should be a subset of $1, not the other way round, so Rudi's solution probably won't get the results you want. So let's look at what is wrong...
8,439
Posted By MadeInGermany
grep for items ending with a : grep ':$' The...
grep for items ending with a :
grep ':$'
The $ indicates the line end.
But doesn't the -p option let the ls command add a / to the end of directory names?
Then grep -v '/$' or grep '[^/]$' can...
8,060
Posted By MadeInGermany
ksh does not have the <<< (here string) operator....
ksh does not have the <<< (here string) operator. (An exception are few variants of ksh93.)
In ksh you can do
echo "$var" |
while IFS= read -r dirpath
do
echo "Hi"
done
Note that ksh,...
7,811
Posted By Chubler_XL
I believe perl is available on default AIX...
I believe perl is available on default AIX installations so this could be used to fetch the file modification time eg:

perl -e 'use POSIX qw(strftime);use File::stat; print strftime($ARGV[0],...
7,811
Posted By MadeInGermany
Try the following echo "$(find...
Try the following
echo "$(find /app/logs/fname1.out -ls) $(cksum<fname1.out | cut -d' ' -f1)"
Too much information? Pipe the find output to cut and select the desired fields! (Like you do with the...
2,225
Posted By Neo
Maybe it's because you do not understand...
Maybe it's because you do not understand computers and the basics on how to use them?

For example, if you understood computers, you would tell us exactly what computer use are using and any error...
5,965
Posted By MadeInGermany
The echo command is not portable. Use printf...
The echo command is not portable.
Use printf "%s\n" instead.
cat check.sh
str=`printf "%s\n" "$1" | sed -e 's#\\\\n# #g'`
printf "%s\n" "$str"
str=$(printf "%s\n" "$1" | sed -e 's#\\\\n# #g')...
5,290
Posted By anbu23
$ echo '/fin/app/scripts\\n/fin/app/01/sql' | sed...
$ echo '/fin/app/scripts\\n/fin/app/01/sql' | sed -e 's#\\\\n# #g';
/fin/app/scripts /fin/app/01/sql
$ echo '/fin/app/scripts\\n/fin/app/01/sql' > file
$ sed -e 's#\\\\n# #g' file...
4,497
Posted By rdrtx1
try: if [ "$line" != "\n" ] in case $line is an...
try: if [ "$line" != "\n" ] in case $line is an empty string.
Showing results 1 to 25 of 257

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