Search Results

Search: Posts Made By: Soham
2,617
Posted By MadeInGermany
wait? Will not help. The problem is that ssh...
wait? Will not help.
The problem is that ssh sucks from the input, here file1.
The simple solution is
ssh -n ... or </dev/null ssh ...
5,286
Posted By MadeInGermany
You forgot to reset j j=1 while [[ $j...
You forgot to reset j
j=1
while [[ $j -lt 3 ]]
5,286
Posted By RudiC
j remains at value 3 once it reaches it. Reset to...
j remains at value 3 once it reaches it. Reset to one just before the j loop.
1,879
Posted By MadeInGermany
With a classic for loop: for f in *; do cp "$f"...
With a classic for loop:
for f in *; do cp "$f" /other_dir/ABC_"$f"_`date +%m%d%y`; done
4,305
Posted By Chubler_XL
If you are looking for files that belong to a...
If you are looking for files that belong to a userID or groupID that is not current in your system try -nouser or -nogroup

For example where userID 57484 does not exist in the system:
$ chown...
4,356
Posted By Scott
Does ^K appear to be a single character on the...
Does ^K appear to be a single character on the screen (that is, when you move the cursor over it (in vi), does the cursor move only to the ^ or also to the K)?

catting the file will typically not...
4,356
Posted By RudiC
That ^K in fact IS invisible when printed with...
That ^K in fact IS invisible when printed with normal methods.. You have to make it appear by special options like the -v to cat, or use commands built for that, like od.
3,904
Posted By drl
Hi. This looks like it does what you wish: ...
Hi.

This looks like it does what you wish:
$ cat z8; tr '_-' '-_' < z8
abc-def_hij-klm_nop-qrs_tuv-wxy_z
abc_def-hij_klm-nop_qrs-tuv_wxy-z
and
$ echo "$s" ; echo "$s" | tr '_-' '-_'...
2,784
Posted By RudiC
Try also awk 'sub ("^001.","&##") {sub (/##../,...
Try also
awk 'sub ("^001.","&##") {sub (/##../, " ")} 1' fileYou may want to choose a better placeholder pattern / value.
2,784
Posted By Don Cragun
Setting FS and OFS to an empty string to treat...
Setting FS and OFS to an empty string to treat character positions as fields is a GNU extension that is not supported by nawk, /usr/xpg4/bin/awk, nor required by the POSIX standards. Just using...
2,784
Posted By vgersh99
different tack: nawk '/^001 / {$0="001 "...
different tack:

nawk '/^001 / {$0="001 " substr($0, index($0," ")+3)}1' myFile
or try this - Solaris' awk/nawk are finicky...

nawk 'BEGIN {FS=SUBSEP}/^001 / {$0="001 " substr($0,...
9,013
Posted By vgersh99
OK, this is not a Julian date - this the...
OK, this is not a Julian date - this the cumulative number of day since the begining of the year....
But you can utilize the gre2jul conversion and substraction for Jan/1 - using the same command...
1,175
Posted By jim mcnamara
var=$(printf "%100s" " ") && echo "length of var...
var=$(printf "%100s" " ") && echo "length of var variable = ${#var}"


The first part assigns spaces to var, the second part is just information to show it worked.
1,793
Posted By rbatte1
Firstly, I would add the -b flag to ignore...
Firstly, I would add the -b flag to ignore leading blanks, just in case. You also need to beware that LDAP supported group names can contain spaces, so that throws things out of what as to what is...
1,793
Posted By bakunin
The reason is the way the shell parses its input....
The reason is the way the shell parses its input. We tend to implicitly take for granted that spaces (or other whitespace) separate parts of the shells input (the "command line"), but that is not...
1,524
Posted By apmcd47
a="abc" b="def" c="ghi" printf...
a="abc"
b="def"
c="ghi"
printf "%-41s%-31s%s\n" $a $b $c

Read up on printf to see what is happening, but basically I am telling it to left-justify the strings in the fields of the given...
1,524
Posted By Chubler_XL
Try this: $ cat infile test one ...
Try this:

$ cat infile
test one
12345678901234567890123456789012345678901234567890123456789012345678901234567890
two

$ awk '
BEGIN{
R[1]="abc"
R[42]="def"
R[73]="ghi"
...
1,435
Posted By vbe
Tried: ssh <hostname> ls >$HOME/ssh_out.log ...
Tried:

ssh <hostname> ls >$HOME/ssh_out.log

yet?
2,138
Posted By jim mcnamara
You have to write something that creates a file...
You have to write something that creates a file mtime in epoch seconds, then formats it usefully:

filetime()
{
perl -e '
use POSIX qw(strftime);
$mtime = (stat...
6,381
Posted By aksijain
Yes.. that is the file Soham, last reads from...
Yes.. that is the file Soham, last reads from that file /var/adm/wtmpx.

Since it does not have data of last one year. You cannot view it with last command.
It nullifies after every reboot.
6,381
Posted By vbe
If you did a little search in the forums, you...
If you did a little search in the forums, you would have found e.g.

https://www.unix.com/shell-programming-scripting/115495-need-year-value-users-last-login.html
6,381
Posted By Skrynesaver
How old is your oldest /var/log/wtmp* file, I...
How old is your oldest /var/log/wtmp* file, I doubt that this is the issue you think it is (you could test with a wtmp > 12months old of course.
6,381
Posted By aksijain
last command reads from wtmp.. you sure that wtmp...
last command reads from wtmp.. you sure that wtmp is since the last year?
Showing results 1 to 23 of 23

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