I'm trying to capture the date/time portion of "ls -l" command as a file, but it puts a "blank line". How do I make it so that output file doesn't include a blank line?
Example 1 (saved as a variable works good):
var1=`ls -l /file1 | awk '{print $6,$7,$8}'`
echo $var1
May 24 23:06
Example 2...
I'm unable to move a file that I do not own but I'm part of the group the file is assigned to.
Here's the scenario:
userA owns file1
userA belongs to groupX
userB belongs to groupX
file1 has rights of 666
file1 is located in dir1
dir1 and dir2 are owned by userB
dir1 and dir2 are group owned...
Thanks for your input DukeSSD.
I was also leaning towards Virtual Ethernet Adapter method.
fyi: there are two frames connected via a switch used to connect the two frames to be on one subnet.
I'm trying to configure NIM Master server with 30 clients on Virtual Ethernet Adapter network because the current network setup will not work with NIM for me (bootp can't find the master). Probably need to create a new network to get it to work.
My environment is 2 P5-590's (connected via...
PHV,
It works as a one liner, but I get an error when I put it in a script:
#!/usr/bin/ksh
ssh server1 awk -F":" '$1!~/^[a-z][0-9][0-9][0-9][0-9]$/{print $1}' /etc/passwd
Syntax Error The source line is 1.
The error context is
>>> !~ <<<
awk: 0602-540 There is a...
I need help with a script to find only users that starts with a alpha character followed by 4 digits (ie. a9999).
Here's what I did so far (not working):
#!/usr/bin/ksh
cat /etc/passwd | awk -F: '{print $1}' |
while [[ $MORE -ge 1 ]]
do
read USER
if [ len(USER) == 5 ]
then...
I have two files that contains just file names.
The first files has the nfs mount points (ie. /mnt, /nfs1, etc.)
Second file has long file names (ie. /usr/bin/perl, /nfs1/file1, etc.)
I want the third file to contain only the non-nfs mounted files.
Example:
file1:
/mnt
/nfs1
/nfs2
file2...
You were right feherke, it worked when I took out the echo command.
PHV, your simplied version worked too.
You guys really know your stuff!
Thanks a lot!
Sorry, I substituted your printf command, but it didn't work... same output display.
I think because I'm writing to an output file it's not taking \t in the printf command... any other ideas?
Thanks PHV.
I'm trying to line up (align) output from "ls -l". I have the following awk command in a script that writes to a file (INFILE has bunch of file names):
#!/bin/sh
for LINE in `cat ${INFILE}`
do
echo `ls -l $LINE | awk '{printf ("%s %s:%s \t %s\n",$1, $3, $4, $9) }'` >> ${FORMATTED}...
I need to find all occurrences of a particular string "Error code 27" from the whole server? I also need the file name associated with it.
I tried the following command, but I only got the results from the current directory: > grep "Error code 27" *
I need to go to all sub-directories and...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.