Search Results

Search: Posts Made By: Ashishp
2,680
Posted By Ashishp
User dir access using ~ in sh
I am writing code to copy file if user dir exists.
Code snippet :

#!/bin/sh
if [ -d ~user1 ]
then
cp ~user1/file file
else
cp ~user2/file file
fi

This code works if shell is ksh but not...
Showing results 1 to 1 of 1

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