Search Results

Search: Posts Made By: natraj005
1,668
Posted By RudiC
You've fallen into the same trap as in your other...
You've fallen into the same trap as in your other thread (https://www.unix.com/shell-programming-and-scripting/272879-how-get-value-file-serach-value-filename-dir.html). Don Cragun pointed the syntax...
1,668
Posted By Don Cragun
From what you have said, presumably /home/$chat...
From what you have said, presumably /home/$chat expands to the home directory for the user named by the expansion of $chat (/home/ram, /home/suresh, and /home/John, respectively for the three lines...
1,668
Posted By Corona688
OK. Have you tried the code I posted? It reads...
OK. Have you tried the code I posted? It reads line by line without any need for grep or ed.
2,389
Posted By methyl
Unless you have an unusual version of ls, that...
Unless you have an unusual version of ls, that output is impossible.
Anyway we now know that "yahoo" is a directory and that there is probably only one script and that it probably does not vary its...
2,389
Posted By methyl
Off topic: The $PATH environment variable is...
Off topic: The $PATH environment variable is reserved for the Shell. Choose another name for your environment variable ... $SEARCH ?

If you overwrite $PATH in the manner of your script, the Shell...
2,389
Posted By complex.invoke
$! holds the PID of the last background process...
$! holds the PID of the last background process that was executed
2,253
Posted By shamrock
Nice one...but to make it work on all flavors of...
Nice one...but to make it work on all flavors of unix the paste command needs to be "paste -sd: -" as legacy unixes dont understand stdin without the - placeholder.
1,981
Posted By ctsgnb
using "sed -i" would alter the inode of the file....
using "sed -i" would alter the inode of the file.
using an "ed -s" instead would avoid this drawback.

printf "1d\nw\nq\n" | ed -s yourfile
Forum: Solaris 07-13-2010
20,041
Posted By kurumi
#!/bin/bash i=0 while read -r LINE do ...
#!/bin/bash

i=0
while read -r LINE
do
((i++))
echo "$LINE"
if [ "$i" -eq 3 ];then
echo ""
i=0
fi
done < "file"
12,280
Posted By clx
awk -F "|" 'NR==1 {print $1}' test Use nawk...
awk -F "|" 'NR==1 {print $1}' test

Use nawk or /usr/xpg4/bin/awk on solaris.
12,280
Posted By ygemici
# cat infile dsd|dfsd|Sdfsdf|sdff ...
# cat infile
dsd|dfsd|Sdfsdf|sdff
sdfwert|5rygrd|trhyr|dsfsd
edfgsd|aserhtrh|hjfg|


# sed -n '1s/^\([a-z]*\)|.*/\1/p' infile
dsd
3,173
Posted By hergp
You can omit the print statement, because it is...
You can omit the print statement, because it is the default action.

awk 'NR!=2 && NR!=6' txt1

I tend to use the print statement anyway because of readability.
Showing results 1 to 12 of 12

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