Please use CODE tags (not ICODE tags) for full-line and multi-line sample input, output, and code segments.
This might work on some systems using some shells, but there are a few problems:
Using find ./* ... can give you argument list too long errors when invoked in directories containing lots of files and/or several files with long filenames. It would be better to use find . ....
If there is a file named source_file.txt in more than one directory in the file hierarchy rooted in the current working directory, you will be invoking cd with two or more operands instead of the single operand you're assuming will be specified.
The standards say that commands in a pipeline can be executed in a subshell environment. If cd is executed in a subshell environment, the current working directory of the shell execution environment you will be in when the pipeline completes will not have been changed.
If the intent is to move into the directory containing a file named example.txt and do something in that directory for each directory that contains a file by that name, something more like:
This was written and tested using a Korn shell, but this should work with any shell that performs the basic parameter expansions specified in the POSIX standards.
Hi,
I have a file with about 60 lines of path:
app-defaults/boxXYZ.......
I want to change this to /my/path/goes/here/app-defaults/boxXYZ, but of course vi doesn't like the regualr :s/old/new/ command.
Is there any other quick way to do this?
Thanks ;) (2 Replies)
hi every one ,
here is my problem !!
i have to run my script from an account and update the result in a xml file located on a different account. i use existing ssh keys to do it remotely
for example the tags looks like this
<PropertyValueList... (1 Reply)
using OS X and the Terminal, I'd like to find all locked files in a specified directory, unlock them, and print a list of those files that were unlocked
how can I do this?
I'm familiar with chflags nouchg for unlocking one file but not familiar with unix enough to do what I'd like.
Thanks! (0 Replies)
Hi,
I have a file abcd.txt which has contents in the form of full path file names i.e.
$home> vi abcd.txt
/a/b/c/r1.txt
/q/w/e/r2.txt
/z/x/c/r3.txt
Now I want to retrieve only the directory path name for each row
i.e
/a/b/c/
/q/w/e/
How to get the same through shell script?... (7 Replies)
Hi All,
The script below read the path and searches for the directories/subdirectories and for the files. If files are found in the sub directories then read the content of the all files and put the content in csv(comma delimted) format and the call the write to xml function to write the
std... (1 Reply)
Hi,
Here is my sendmail script.
#!/bin/ksh
{
# print "From: user1@`hostname`"
print "To: me@mycomp.com"
} | /usr/sbin/sendmail -t
I wish to use sendmail without having to specify # print "From: user1@`hostname`" so that it picks or formulates the default value of... (1 Reply)
Currently I am using this laborious command
lvdisplay | awk '/LV Path/ {p=$3} /LV Name/ {n=$3} /VG Name/ {v=$3} /Block device/ {d=$3; sub(".*:", "/dev/dm-", d); printf "%s\t%s\t%s\n", p, "/dev/mapper/"v"-"n, d}'
Would like to know if there is any shorter method to get this mapping of... (2 Replies)
Hello,
I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
I'm curious to know how do I add an empty log file (test1.log) to an existing text file to monitor all the changes made to a.txt.
Is this expression
export PATH=$PATH:/home/test1.log
right to be added to the text file a.txt? (5 Replies)