Search Results

Search: Posts Made By: MadeInGermany
Forum: Shell Programming and Scripting 6 Hours Ago
151
Posted By MadeInGermany
Maybe you hit the LINE_MAX=2048? This should...
Maybe you hit the LINE_MAX=2048?
This should be the buffer for a physical line (usually an input line).
Try to construct a longer virtual line by inserting a \ at the very end of the physical...
Forum: Shell Programming and Scripting 7 Hours Ago
151
Posted By MadeInGermany
xargs is cheating: it runs the ksh with max_args...
xargs is cheating: it runs the ksh with max_args then again with the remaining args...
A correct test is
ksh arg.ksh $(cat 5k) | wc
Forum: Shell Programming and Scripting 20 Hours Ago
120
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...
160
Posted By MadeInGermany
The first line backs up &0 (=stdin) to &10. The...
The first line backs up &0 (=stdin) to &10.
The next line associates &0 with the file (the file is opened for reading).
Then all following stdin/default reading is from the file. Here it is the...
290
Posted By MadeInGermany
Straight forward: find . -type d \( -path dir1...
Straight forward:
find . -type d \( -path dir1 -o -path dir2 -o -path dir3 \) -prune -o -name '*rpm*' -print
Note that the default is -a locigal AND and has higher precedence than -o logical OR. So...
290
Posted By MadeInGermany
Doesn't it make more sense to have the -type f...
Doesn't it make more sense to have the -type f right from the -o?
Also, if -prune is true then it is printed, unless there is an action like -print or -exec on the other branch.
find / -path /u...
118
Posted By MadeInGermany
Exclude files that start with a dot like...
Exclude files that start with a dot like .profile:
find . -type f -name '?*.*' | awk -F. '{a[$NF]++} END {for (i in a) print FS i ": " a[i]}'
You can easily postprocess it with | sort -k2n
258
Posted By MadeInGermany
If your output were the input file then you would...
If your output were the input file then you would use another cut -d '.' -f 1 on it.
You can chain the two cut commands with a pipe:
cut -d '/' -f 12 out.out | cut -d '.' -f 1
cut reads from the...
235
Posted By MadeInGermany
With shell builtins we are close to your initial...
With shell builtins we are close to your initial attempts :
while read tabschema tabname
do
echo "select * from $tabschema.$tabname"
done < Tablist.txt
214
Posted By MadeInGermany
In a standard shell the status variable is $? ...
In a standard shell the status variable is $?
In csh it is $status.
bash is a standard shell, and also has $status as a synonym for $?
233
Posted By MadeInGermany
Your words are unclear, and your code sample is...
Your words are unclear, and your code sample is unclear.
Problably you mean
NPUTDIR=/path/with/files
exitcd=44
for i in $INPUTDIR/abc*.dat
do
if [ -f $i ]; then
echo...
229
Posted By MadeInGermany
You must capture a digit that is followed by a...
You must capture a digit that is followed by a space. Because all the matched part is substituted, you must put it back with \1 and \2 that refer to the 1st and 2nd \(capture group\).
sed 's/\(Oct\)...
Forum: AIX 5 Days Ago
3,113
Posted By MadeInGermany
This is always true, not only for AIX. For...
This is always true, not only for AIX.
For example in Linux, paging is the better alternative to its awful "OOM killer".
Always gives the system some swap!
883
Posted By MadeInGermany
Attention: ssh -qn is ssh -q -n where -n...
Attention:
ssh -qn is ssh -q -n where -n inhibits reading from stdin - good for ssh -q -n remotehost remotecommand. But it must be ssh -q remotehost < file and ssh -q remotehost << heredoc and ...
233
Posted By MadeInGermany
Using the file_exists function...
Using the file_exists function (https://www.unix.com/shell-programming-and-scripting/252233-tip-file_exists-function.html)
if file_exists $inputdir/abc*.dat
then
echo "a file exists"
fi
397
Posted By MadeInGermany
The RE searches require some quoting effort. ...
The RE searches require some quoting effort.
The index() function searches for plain strings and returns the position.
Also only the comments left from the search string matter.
Two reasons to go...
Forum: Ubuntu 1 Week Ago
671
Posted By MadeInGermany
sudo does not forward/auth the X11display. ...
sudo does not forward/auth the X11display.
Perhaps su does it?
su -c "iw dev wls4 connect <SSID>"
Do you get any error message?
Is there any error in the /var/log/messages file or the system...
576
Posted By MadeInGermany
fgrep -v -x -f is more precise than grep -v -f...
fgrep -v -x -f is more precise than grep -v -f because it compares the full lines.
For ex bc should not match abc or bcd.
(A halfway approach would be grep -v -w -f that at least checks for word...
157
Posted By MadeInGermany
I don't know about the Ultra-30 but maybe it...
I don't know about the Ultra-30 but maybe it should be
output-device=screen
input-device=keyboardThat you can set on the firmware prompt with
setenv output-device screen
setenv input-device...
616
Posted By MadeInGermany
Some awk versions have a problem with parsing a...
Some awk versions have a problem with parsing a complicated FS.
The following variant takes a simple FS:
awk -v want="CITY,REGION,STREET" '
function prnsection() {
if (length(section)) {
...
137
Posted By MadeInGermany
To replace the 2nd string2 is easy sed...
To replace the 2nd string2 is easy
sed '/string1/s/string2/string3/2' TextFile
But this searches string1 throughout the line, then starts over and substitutes the 2nd string2 from the beginning of...
560
Posted By MadeInGermany
If parameter $1 contains literal \\n then you can...
If parameter $1 contains literal \\n then you can use sed to convert to a space
VAR1=$(printf "%s\n" "$1" | sed 's/\\\\n/ /g')
The \ and \n are really special. Some explanations:
I used ' '...
Forum: Shell Programming and Scripting 2 Weeks Ago
560
Posted By MadeInGermany
In single quotes you must not \escape the...
In single quotes you must not \escape the \escape:
./loopissue.sh '/tmp/scripts\n/tmp/mrt\n/tmp/exe'The shell removes the 'single quotes' and the "double quotes" before it invokes the loopissue.sh....
Forum: HP-UX 2 Weeks Ago
606
Posted By MadeInGermany
IMHO cron merges stdout and stderr by default. ...
IMHO cron merges stdout and stderr by default.
So there is no need for exec 2>&1.
432
Posted By MadeInGermany
Releasing a certain logical disk is easy: just...
Releasing a certain logical disk is easy: just swapoff it (that can take some time if swap is in use - the swapped blocks need to be shuffled into RAM).
Then you can lvresize it.
Then swapon -v it...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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