Can someone delve more into what below test command do?
if ; then
I know -t is for file descriptor
-t
file descriptor FD (stdout by default) is opened on a terminal
But not sure how to relate to it..
$1 is supposedly first argument, so let's say if
scriptname:... (2 Replies)
hey guys. I'm trying to create a command file that moves my emails to a specified folder according to a keyword that is in the subject.
like move emails with "hey" in the subject to a folder that exists in my mail folder named "hey". how do I go about that? thanx. (9 Replies)
Can you please tell me how to find a file in a directory and then if it exists i need to place it in a different folder?
I have to use "ls -lt" command
I mean this command is something existing one . can you please tell me how i set the directory path. Like
dir1/dir2/filename.csv to... (8 Replies)
Is there a way to move the files ALONE from one dir to another dir?
In my source dir,I have files as well as directories.I want to move the files alone to another dir and the directories should remain undisturbed.
If I use mv * < target dir> ,then the directories also moved.
Any... (4 Replies)
What awk command will test a string to determine if it is a valid file name?
With the following awk statement I isolate the lines from the inputfile that might contain a filename, then I attempt to test the possible filename which is always in $4 from each line. However it is not working at all... (4 Replies)
This is the code:
while test 1 -eq 1
do
read a
$a
if test $a = stop
then
break
fi
done
I read a command on every loop an execute it.
I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test.
For example echo hello.
Now the... (1 Reply)
Hi,
I need to move 1000s of files from one folder to another.
Actually there are 100K+ files.
Source dir : source1
Target dir : target1
Now if try cp or mv commands I am getting an error message : Argument List too long.
I tried to do it by the time the files are created in the source... (6 Replies)
I have a script that is inventorying (not sure if thats a word) my environment.
It goes out and pulls Hostname OS, IP, and ENV (dev, prod, etc)..then spits all that to a logfile
At the top of my script i have a check to see if the logfile exist.
] || touch $LOGFILE && echo "ENV" "\t"... (3 Replies)
I have a file in which each line is the name of another file. Is there a way to serve them to the command line? For example, if the file contains
file1.txt
file2.txt
file3.txt
...
file9.txt
is there a way to insert them in the command as a batch?
If I ran a command like
grep... (4 Replies)