Search Results

Search: Posts Made By: AnswerGuy
4,671
Posted By AnswerGuy
Shell script to readlink
The following is a fairly simple little "readlink" shell script using the find command:


#!/bin/sh
LINK="$1"
until [ -z "$LINK" ]; do
cd $(dirname "$LINK");
LAST="$LINK"
...
3,442
Posted By AnswerGuy
Making sense
Newbewie,

I'm sorry to say that you're not making any sense to me. You say you're executing a command on a 100 hundred hosts and then your message talks about wanting to number the lines in a...
87,223
Posted By AnswerGuy
Regarding handling path/filenames with possible...
Regarding handling path/filenames with possible embedded spaces:

An awk idiom for removing just one or a few fields and printing "the rest of a line" (without an explicit for loop) is to simply...
14,014
Posted By AnswerGuy
Do my homework?
You need to write a program, in C, which has to operate as a simplified UNIX shell. You're expected to implement "around 20 basic commands" --- which which I suspect you mean there are about twenty...
15,724
Posted By AnswerGuy
How to work around tool limitations ...
If you're going to be a UNIX/Linux scripting professional you're going to encounter lots of tools which were written decades ago with hard-coded limits that, by today's standards, are pathetic.
...
2,970
Posted By AnswerGuy
NUL terminate first field of each line?
Rahul,

It sounds like you're trying to NUL terminate the first (whitespace delimited) field (word) of each line in a text file.

That's a very odd request (because the ASCII NUL character is...
3,442
Posted By AnswerGuy
Line number with word count for every line?
Newbewie,

I might not be clear on what you're asking for but it sounds like you want the output to be something like prefixing each line with it's line number and it's "word" count.

If that's...
87,223
Posted By AnswerGuy
GNU find $DIR -printf "%T@ %p\n" | sort -n | head -1
I would use the following command (assuming I had GNU find available):

find $DIR -printf "%T@ %p\n" | sort -n | head -1

The %T is modification time in a custom format; @ is the format specifier...
Showing results 1 to 8 of 8

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